How to loop multiple rows


Hope these steps would help you resolve this

  1. Use a FOR EACH ROW loop and pass the dt variable as input

  2. Inside the loop use a assign activity like

Counter = 0

Where counter is a variable of type int32 with default value as 0 created in variable panel

  1. Followed by this assign use a WHILE LOOP inside the loop and pass the condition like this

counter < dt.Columns.Count

  1. Inside this while loop use a TYPE INTO Activity like this with the inlut


This will type the first row and first column

  1. Inside the same while loop next to the above activity use a assign activity like this

counter = counter + 1

Now this will increment the loop and type first row second column and then in next loop - first row third column
Once all three columns are typed, while loop will get over and next row in for each row will start

Which in turn will start again the while loop and type second row first column, second row second column and second row third column

Like wise it goes for all rows and columns

But make sure that you have used dynamic selectors in type into activity by replacing changing attribute values with * wild card symbol
Only then the three columns value will get type to its respective fields
Else it will type in the same field again and again

Hope this would help you

Cheers @tkiran

1 Like