hi,
At first initalize a boolean variable IsNoData = False
2. Inside Do while you can use element exists activity and assign the output to be saved in IsNoData
3. In While condition give it as IsNoData=False
What it does is , Until it finds the element the condition would be false and it wil be iterated. When it finds the element it will come out of the loop.