Hi i need your help for my case,
i have string = “123”
and a data table of = dt_Original
i want to search for a cell/index from the dt_Original which match with my string “123”
if its found then return the index , if not then it will return -1
also i dont know in which column i need to search , so i want to search in every column in the data table.
Hi @StevenIsRobotOnline ,
You can use for each row or for each loop,
you can even get with assign activity, the exact value of cell of a datarow in a datatable…like this
assign activity(for datatable named dt_Original), for first row and 10th column
out_value = dt_Original.Rows(0)(9).ToString
if out_value = “123”–>return
the reason for 0 and 9 instead of 1 and 10 is the rows and columns are usually taken with 0 index.
Hope this would help you
regards,
LNV
Hey @StevenIsRobotOnline ,
I’ve replicated your scenario with my own dataset
And successfully solved it.
Refer below screenshot for my input data
So in the above data i am finding the index of the word "Sara"
Below is the code i used
(
From row In dt_1
Let rowIndex=dt_1.Rows.IndexOf(row)
Let a = If(row("City").ToString.contains("Sara"),rowIndex,-1)
Select a
).Max