How to store a value from an excel file which matches to an argument (previously collected)

Hello everyone,

I need some help. the issue might be simple but i’m still a rookie with UiPath.

I have an excel file with 3 columns (Rayon | Rate | Description).
in a previous workflow I have collected a Rayon number, so then I need to search into the Excel File this rayon number and take the “Rate” link to this Rayon and store this Rate into a varibale.

Thank you
Cheers

You may want to read the Excel worksheet as a DataTable using either the Excel Read Range activity or the workbook Read Range activity.

With the DataTable, you can use the Lookup DataTable activity to look up the “Rayon” and return the rate.

Hope that helps put you in the right direction.

1 Like

Thank you for answering so fast !
So, I’m trying to define the Lookup Data Table but I’m not sure what to write on the output field.

So far, I have filled the ColumnName ; Datatable (input) and the lokup value (I put my argument)
Hope is it correct.
Can you help me please @oddrationale

Hi @najoua.abbaci

  1. Use the read range and create a data table as output.
  2. Use for each row in datatable.
  3. Use get row item and get the values of the Rayon column.
  4. Now use an if condition to match the variable collected in the previous workflow and the output of get row item.

Regards,
Aditya

1 Like

Thank you,
Sorry but can you tell me how can I do the step 3
Use get row item and get the values of the Rayon column. please.

Hi @najoua.abbaci

You can get more info here
https://docs.uipath.com/activities/docs/get-row-item

let me know if this helps

Regards,
Aditya

1 Like

Using the Lookup Data Table activity, put “Rayon” as the Lookup ColumnName. “Rate” as the Target ColumnName. The DataTable variable you used for the Read Range goes in the Input DataTable field. And the Rayon value from your other workflow goes in the LookupValue field. Create a variable for the Output CellValue which will contain the matching rate for the given Rayon.

Using a For Each Row activity as also suggested could also work. But would not be as efficient because you have to manually loop through the rows rather than just looking up the value directly.

2 Likes

Hi @najoua.abbaci

Lookup Datatable is the Best way to implement this as @oddrationale said.

Regards,
Aditya

1 Like

Thank you both of you @desineediaditya and @oddrationale
Both solutions worked
I kept the LookUp Data table solution

thank again @oddrationale

Cheers

2 Likes

Hi @najoua.abbaci
Mark the one with solved the query that will be useful for others to navigate quickly.

Regards,
Aditya

1 Like

Yes sure, i did it already !
Cheers

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