Row Index read one column return another


I have two columns in Excel. How to read Column G based on user input variable then output value in column H?


For example,
Arr input = {“A”, “D”}
then I want {“111”, “444”} as output

I read excel and put the data into a datatable, then what?
I have trouble getting the row index of column G based on input, please help.
After getting the row index, I am thinking to use for loop and get row item for Column H.

I have 2018.1 version



  • Use Input Dialog activity to get input.
  • Assign String2 ="[Column7]=’" + userInput.tostring + "’).item(“Column8”).tostring


Thanks for your response!
Your syntax doesn’t work.

I have imitated yours and tried this method but got an error:"[ID]=’" + “’” + idStr + “’”).Item(“Invoice ID”).ToString


test is a str.

Also, please note that although user’s input is a string, but the string has to be split into array because (as in my original post):

Str = “A, D”
StrArr = {“A”, “D”}
Then I can find the corresponding number in column H (“111”, “444”)

Can anyone help? Thanks


If you already have string array for user input u can
1.use for each for array for each row activity inside array foreach take datatable which is read from excel
3.if row.item(0).ToString =item.tostring
Inside if use write line row.item(1)

This is only if your data table has just 2 columns else change column indexe to appropriate values

Use the below code :slightly_smiling_face:

  • For each row in dt
  • If StrArr.contains(row(0).tostring)
  • In writeline - row(2).tostring