Iterating through datatable in UiPath


#1

I want to iterate all the datatable rows using For Each row. I have 6 columns in my datatable. I have to iterate all the rows one by one in Uipath. Any suggestions please.I am trying to taking all webpage links from data table and clicking the same on webpage using some common properties. If Any example available like such a scenario Please upload.


#2

Hi @Amol1,

Use the For Each Row activity, each row item will be a data row type, inside the For each row you can use assign activity to assign values like: row(1) = “Test Value”

Here (1) means the second column in your data table. The values are index based so starts from 0 and you mentioned you have 6 columns so it goes up to 5.

In your click selector you will need to add the webpage link column as a dynamic selector.


#3

Inside your for each row activity, you can use the “Get row item” activity for each column in your datatable. In the properties, name the ColumnName the same name as your columns in your data table. create a variable for each column in the output properties, and now your bot will be able to perform activities on these variables for each row in your datatable!