How to verify contents of each cell in data table - Boolean expression / If activity

For data table A I want to verify that all cells in the data table contain a value > 0. i.e. if the table has a value =< 0 the flow will go to ‘Else’

For data table B I want to verify all cells contain a certain phrase/string e.g. “ABCD”. i.e. If any cell contains a value besides “ABCD” the flow will go to ‘Else’

I have For Each Row in Data Table activity and an If activity in the body. What expression can I use in If Condition to verify the data table?

Or should I use different activities?

Thanks!

@ljones

Try this once

currentrow.itemarray.all(function(a) cint(a.tostring)>0)

Hey @ljones ,

You can try below query in your If activity

currentRow.ItemArray.All(Function(cell) cell.ToString.Contains("ABCD"))

Hope it helps you!

Bonus Note: You Can use LINQ instead of For each row in data table activity

Hi @ljones

Can you try this condition

Cint(CurrentRow(“YourColumnNameNumbers”))>0 AndAlso CurrentRow(“YourColumnNameString”).ToString=“ABCD”

I get the following error: If: Conversion from string “” to type ‘Integer’ is not valid.

This worked for me. Thank you for your help!

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