For Each Row in Nested Data table based on Condition

Hi All,

I am trying to iterate through 2 Data Tables in For Each Row.

1st Data Table will have few rows(ex: 5 rows), in which one column is having quantity (ex: 10 rows)

Based on this quantity value, from 2nd Data Table BOT need to pick that many rows (ex: first 10 rows)

After first iteration in the 1st DT, the quantity will be different (ex: 15 rows).

Now from 2nd Data Table, BOT need to pick from 11th row and execute these many rows (11th to 25th row).

How to achieve this in UiPath, any help would be appreciated.


  1. Read data into a data table.
  2. get the count of data table from firstDataTable.
  3. skipRows = 0
    takeRows = Count
    newdt = mySecondDataTable.AsEnumerable().Skip(skipRows).Take(takeRows).CopyToDataTable
    skipRows = takeRows

Skip - Will skip the given number of rows
Take - Will take the next given number of rows

Karthik Byggari


Thanks a lot Karthik. It worked…:smiling_face_with_three_hearts:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.