How can I add a condition to the range selection in a loop

How can I add a condition to the range selection in a loop, for example, I want to start reading from this row when the value in the 5th column is “YES”?

Hi @735736407

Use an if condition inside for each row in datatable

For Each row in YourDataTable
    If row(4).ToString.Trim.ToUpper = "YES" Then
     ......
    End If
Next

If you know the column name use row("Columnname").tostring.Trim.ToUpper="YES" in the if condition

Hope it helps!!


So how would I write that expression in the input box?

@735736407
Use for each row in datatable activitiy

@735736407

And then what do I do next with that, so my situation is, let’s say I have 20 rows of data, and row 4 and column 5 is YES, so I’m going to loop from row 4 all the way down to the last row, and I’m going to get the value of each row

@735736407,

Use Filter Data Table activity to filter only rows who’a 5th Column = YES. This will give you only the required or qualified rows.

Just use For Each Row in DataTasble to iterate this data then.

Thanks,
Ashok :slight_smile:

Thanks, but my current situation is, let’s say I have 20 rows of data, and row 4 and column 5 is YES, so I’m going to loop from row 4 all the way down to the last row, trying to get the value of each row

@735736407,

Ohh ok. In that case, you will have to use for each row in data table activity and inside this, add if condition to check column value = Yes.

Thanks,
Ashok :slight_smile:

Well, if there’s no other way, that’s it

Thanks,
C

@735736407,

Yes, that’s the way!

Thanks,
Ashok :slight_smile: