How to check which column contains a certain value in a row

Using the For Each Row activity I want to be able to check which column contains the string I am looking for. How can I do that?

@dvn - you can try like

1 Like

Check below
0 means 1st Column
Test.xlsx (8.3 KB) StringKnow.xaml (9.2 KB)

Are you checking column by column, or row by row?

For example, if you have a table and you just want to see if the whole column contains a value, then @dvn’s example should work, and you could also use that type of expression while iterating through the columns using a ‘For Each’ and having the columns as the item variable type (note - not a ‘For Each Row’)

That would be if you wanted to just check the whole column, however if you wanted to do this on each specific row, you will have to first use a ‘For Each Row’ to iterate through your Dt row by row, have a ‘For Each’ within that to perform a check like the one above, by checking each column in the row