Declare and use global variable

activities
#1

I have declared three variable like “Name”, “Age” and “Height” in a separate workflow called “Global Variable Declaration” so that I can invoke to the “Main” workflow.

The declared variable is assigned to the default value.

I have even two workflows called “John’s detail” and “Ann’s detail” which should be invoked to the “Main” workflow. In “John’s and Ann’s detail” workflow, I have to use those variables which are declared in the “Global Variable Declaration” workflow.

So my problem is, how to invoke those variables which are declared in “Global Variable Declaration” workflow so that I can use in other two workflows called “John’s detail” and Ann’s detail"

If someone here could help me with the example with an XML file, I will be really grateful.

#2

Hi @Ugyen_Penjor1
You can invoke those variables using the Invoke wrokflow file activity in the main Workflow.

1 Like
#3

Hi,
You can not :frowning: There is nothing like “global variable” in UiPath. Variable scope is limited to the workflow where it is defined in, e.g. scope of your “Name”, “Age” and “Height” wariables is only the workflow called “Global Variable Declaration”.

In order to exchange values across workflows you would need to declare our variables in Main and exchange via workflow ARGUMENTS.

Cheers

1 Like
#4

Further discussed also here: Use of global variable

1 Like