Assign filtered datarows inside for each loop

I am filtering a datatable using For each Row , and all the results need to be pasted into a dynamic array

Hi…

The issue you are facing is not stated here. But with what hou have mentioned i can give some tips…

You ca filter a datatable without looping in a for each loop easily… use the aasign activity. In that under valuea sections use below as an example
DatatableVariable.Select(“name = ‘lahiru’ And status = ‘Active’”)

This will add all records to a array variable.

If you want to specifically loop through the datatable and add the filteres data to an array, i would suggest to use a List variable. List is is easily to use when you want to add data elements time to time. You can use add to collection activity to add items to the list in the for each loop

Hope it helps…

Thank you this helps a lot.
I actually have to select the rows from my data table according to column 4 and retrieve their respective column 6 value( retrieve and get them in the array/list)

You can do the filtering as i mentioned for column 4. Once the data is in the array, you can then loop through the array to get values from column 6

Array(5).ToString

Array index starts from 0. So column 6 is actually 5 in array