I have an interesting problem looping through a data table. I cannot seem to find the answer anywhere else so I hope that someone can help me.
My process is as follows:
Navigate to a website
Click a refresh button to bring all new records to the top of the list (20 records at a time)
Build a data table from values found on the screen
For each row in the data table, download all new records (This works and breaks after this step)
5.Once the robot completes the download of the first 20 files, I move back to the first log message activity. The loop is supposed to restart, it seems like the data table expands to 40 records but the robot cannot find those records on screen.
ISSUE:
List item
The initial data table is built with the 20 records on the screen
It appears that when the data table rebuilds it finds the next page of records without refreshing the page
The robot appears to get stuck on row 23 but rows 21-40 are not visible on the screen.
The status button is the refresh button as you will see in my screenshots.
Can someone help me fix this loop so I am properly refresh the records and continue downloading the next batch of new files?
When I rebuild the data table the second time the robot is looking to download a file in the header row of the DT despite the header not having “New” in any of the cells.
In the “For Each Row” activity, add a “If” activity inside the loop.
In the “If” activity, specify a condition to check if the current row is the header row. For example, if the first cell in the header row contains the text “Order Number”, you can use the following condition:
row(0).ToString() != "Order Number"
If the condition is true, then the robot will process the current row. If the condition is false, the robot will skip the current row and move on to the next one.
This approach will ensure that the header row is ignored and only the relevant rows are processed.