Getting corresponding value in datatable

Hello friends!
I have a data in the excel (example): ui

I need to find a value from column A and extract coressponding value from Column B same row.

For example:
First run i will input value: “100” it will find a value in datatable and give me output of “Michael”
Second run i will input value: “300” it will output “Chris”

Please help me with above.

  • Use Read Range to get datatable.
  • Use select statement to filter the datatable.

Assign OutputName = DataTable1.select("[Column1]=’+ inputString1 +’")(1).tostring

Hi Michal and Vivek,

The solution with the Select method will work, but starting with UiPath Studio 2018.2 a new activity was introduced specially for this situation - Lookup Data Table.
You need to configure it this way:

  • Input -> DataTable = the output datatable from ReadRange
  • Input -> LookupValue = “100” or “300” - the value you want to find in first column
  • Lookup column -> ColumnIndex = 0
  • Target Column -> ColumnIndex = 1
  • Output -> CellValue = the output variable

Regards
Silviu

3 Likes

Worked, like a charm. Thank you very much Sir.

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