Selecting a datarow from data table while using Foreach loop

Hi Guys,

I am stuck with a small coding issue. So i am reading a datatable i am using a Foreach row in data table, now i have put an If condition where it checks a particular column item. when this condition satisfies i want to select and extract the complete data of that particular row. Now i can’t use the column name or Column index as this is not known.

now i need this data to pass it to another workflow(I am already using the invoke workflow activity) using an argument.

Please help

2 Likes

Hi
welcome to uipath community
yah inside the IF condition once if the condition is satisfied use a ASSIGN activity to get the whole row i.e called as datarow from that datatable
datvar = row

where row is the variable from FOR EACH ROW activity which is the current row under loop iteration and is assigned to a variable of type System.Data.DataRow named datvar defined inthe variable panel

now this variable can be used anywhere

and if we want the all data in that particular datarow then use a assign activity like this
strvariable = String.Join(“-”,datvar.ItemArray)

this will have all the value with - inbetween each value as a delimiter

Cheers @Vishnu.Vijayan

Thank you So Much @Palaniyappan, just 1 more query i have declared an argument with datatype array, as i need to analyse this data on another workflow, so using it at as string(strvariable = String.Join(“-”,datvar.ItemArray), will it actually help?

1 Like

yah if would of course
@Vishnu.Vijayan

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