Match first 2 digit of a column in Excel

Hi Team
I have a scenario in which i have data in a data table after filtration on the basis of component name now i have to match first 2 digit of a column and if it matched i have one workflow to run and if not matched i have another flow.
Below is the example:
|Component1|51974|
|Component1|52765|
|Component1|51987|
|Component1|53765|
In this I have filter the data on the basis of Component Name that is Component 1. Now in another column i have to check first to digit that is 51,52,51,53. I have to check it till the last row, if I found it is not matched in second row or in any row i can exit from the loop with the status not matched. And if till the last the last row string is same like 51,51,51,51 then it will be a case of matched.

Can anybody help me how can i match the string if my data is in data table.

Thanks

Hey @Sonam_N
get first two digits:
firstTwoDigits = row("YourColumnName").ToString.Substring(0, 2)
then use if activity to check if firstTwoDigits matches your criteria (e.g., “51”).
eg.

If isMatchFound Then
    ' Actions for all rows matched
Else
    ' Actions for at least one row not matched
End If
1 Like

@Sonam_N

if you want to check for the below values

You can create an array for your input variables arr_input={51,52,53}

arr_input.contains(CurrentRow(“ColumnName”).tostring.substring(0,2)) gives boolean output