Config values - best practice?

Hi all,

What is the best way to have once place to keep config values (email adresses, username/password, etc etc). This to make it easy to change these values.

I looked into this post (I’m not using the ReFrameWork nor Orchestrator): How to create Config File and How to Use it in UiPath?

However, in my project I would then have to do the following for everywhere a config value is needed:

  1. Use Invoke Workflow to make a call to InitAllSettings.xaml, this will read all the config values every time.
  2. Assign the Out-Config to a variable.
  3. Get the correct value from the variable.

To do all that every time a config value is needed (in different workflows) seems like it will make the workflow to look a bit messy. Is there a cleaner way to do this?
I would want to do step 1 and 2 only once globally for the project, and then only step 3 wherever, in the project, I need a value. Kind of like a static initiation.

So what is the best way to do this?


well, just do it like it is done in ReFramework. You initialize the config dictionairy once and then pass it on as an argument.

First it is an out_argument, you pass it to a variable in your main workflow and from there send it to your other invoked workflows as an in_argument.

Cheers, Lukas

Well having config file is always a best practice to be with a project because whenever a change in input has to be made we can do it very easy and it is available for others as well to make changes

and config file is read in terms of dictionary format that is out_config file is a dictionary variable defined globally in the variable panel
–or if it is invoked inside a workflow like initsettings get the out_config as a OUT argument and assign it to a config named dictionary variable and i hope that is how we do usually in a REFramwork kind of template

–so once if we have the config variable ready we can use any where within that project as that is a global variable and can be used in other invoked workflows as well by passing config with some keys mentioned like config(“keyname”).tostring as a value to any IN argument for a invoked workflow

hope this would help you
Cheeers @P_S

1 Like

This is also an option, but then this has to always be sent as an in_argument to all other invoked workflows… and into the ones they in turn are invoking and so on.
But maybe this is the only way to do this.

Being a Java-developer, I feel like it would have been nice to have a “global project variable” or a static one that is always accessible by all workflows in a project.

well yes unless we dont invoke any workflow we dont need to send them as a IN argument rather we can directly use that variable config along the process
–invoke workflow file is like calling another class in our current class so if we want to make use of the variables defined in the first class we need to assign it here in the new calling class,

hope this would help you
Cheers @P_S

So if we have something like this:

Main_Workflow -> WorkFlow A1 -> -> WorkFlow A2 -> WorkFlow A3 -> WorkFlow A4
Main_Workflow -> WorkFlow B1

And we need a config value in WorkFlow A4 and WorkFlow B1, then we need to initiate the config in Main_Workflow and then send it to A1, A2, A3 and A4 (although not needed in A1, A2 nor A3).
I hope there soon will be an easier way to work with config files and values.

A global project variable! Interesting.

Take a look here: Global Variable
Looks to me, like the UiPath Team is already considering something like this. Maybe @ovi or @loginerror know something more?

Yes, this would be really needful!
Does anyone know the status of this?

Do you often have cases where you’re sending a variable through 4 separate workflows?