Read and then Assign values in Excel as Variables

Hello, I have an Excel worksheet that contains 2 columns and 8 rows. Basically, I would like to store the values in Column B as variable so I can use them in the later part of the flowchart. The reason for having this Excel file is that I would need to change the value in column B from time to time.

Please see the Excel file below

My current approach is below. However, there seems to be a problem storing the variables. I am not sure if Switch Activity is the right activity to be used for this task. Please help… Thank you so much.

Step 1: Excel Application Scope
Step 2: Read Range “A1:B8” then output DataTale “Settings”, and store the Variable as DataTable
Step 3: For Each Row; input DataTable “Settings”
Step 4: In the For Each Row body, use Switch activity; the expression is set as "row(“Settings”).ToString; then for each case, use Assign activity to store all the variables from Excel; for the second row for example, assign PublicFolder = row(“Value”).ToString

See the pictures below


Dear wth1993,

Please find the below attachment for your reference. if found useful please mark as solution.

Excel (21.4 KB)


Thank you very much. It is very helpful. But if I understand correctly, whatever I need to call the value in Column B, I need to type in out_Config(“CorrespondingNameInColumnA”).ToString.

Is there any way I can assign the values as Variables so that next time I need to use such variables I can just type in CorrespondingNameInColumnA rather than out_Config(“CorrespondingNameInColumnA”).ToString? Can I use Multiple Assign activity or else?

Thank you very much!

This is the standard coding procedure which UiPath follows which uses a concept of key value pairs. if you have any changes in the value you are free to change it but key should remain same. if you want you can use Json also with same concept to remove dependency on excel file. Normally the values which are prone to change we keep in assets of UiPath orchestrator.


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