Generate/Assign Values to Variables based on Excel "config" file


I’m looking for a way to leverage a tab in Excel as “configuration” to generate variables and assign data these variablesExample RPA.xlsx (10.2 KB) .

The attached Excel file contains 2 tabs; with the first column on the first tab indicating variable names, and the second column containing the location of values in the second tab, belonging to that variable.

  • As an example, the first variable is simply called Var1, the value from the second tab I’d like to assign to Var1 is in cell A2 (i.e. the value is 54);
  • The second variable is called VarA, with the reference pointing to cell B2 - going to the second tab shows me that this variable should, at the end, be assigned value 26 etc.

Note that neither the variable names, nor the references, need to follow any obvious logic.

What I’m looking for is essentially the following:

I would like to read in the Excel file, process the first tab to generate a new series of variables. Then, these variables need to be assigned the values from the second tab, corresponding to the reference they point to.

I hope that the description is clear. Any help would be appreciated!

Thanks, Philipp

Hi @Philipp_Maier

Use Read range activity and pass the datatable
Use For each row in datatable

use add to dictionary
create an argdicConfig dictionary variable
and pass the key as row(0).ToString
and pass the values as row(1).ToString

and print the value as argdicConfig(“VarName”).ToString
and againdo the manipulation

Ashwin S


Thanks for your help… it worked!