I have created a “Do While” Activity to complete a laundry list of activities for each row in a datatable. The first pass through of robots works fine, but when the bot goes to the next row and completes the same work that it did for the first row, its doesn’t pick up the condition and runs through entire datatable.
Am I using the wrong condition concatenation?
strMasterAccountNumber is dynamic, each time you pass through the “Do While” you get a new number, I need the bot to read the Data Table, and when it find the strMasterAccountNumber that is equal to it, pull the data located on “B+ rowCounter.ToString”
I would recommend using a Read Range and using a For each on the table so you don’t need to check if you are at the bottom of the data, et cetera.
However, if you are using this Do While method, verify that your rowCounter variable is in an outer scope, because if it is decleared in the Sequence scope that it is inside, it will get re-initialized back to 0 each time it loops… basically, make the rowCounter global to the Do While loop.
@Kemal I used a message box to show the variable as a string. I would get the right variable and the condition should have been met, but it still looped through the “Do While”
They’re dynamic, but for the first pass through, when cbsCellValue = 414-0001-4180 it’s supposed to take the data to the right of that cell i.e. “C” + rowCount.ToString.
For the second pass through, when cbsCellValue = 431-0009-0592 the condition is met, but the bot still goes through the loop and doesn’t recognize this.
I’ve used the message box to make sure that I’m getting the right now, and I am