Variable Scope Settings

Hello all,

I was curious if there is a setting somewhere to have a new variable default to the widest scope available instead of going to the “smallest” one it is inside. For example, if have a Sequence inside the Process.xaml and create a new variable, I would like the default Scope to be Process instead of the Sequence that is inside the Process.

Does this exist or is it wishful thinking?

1 Like

@luke.etnier

no it will not exists

the default scope will be the sequence only when you create a variable inside the sequence

if you want to use it inside the process xaml change the scope of it

cheers

Hi @luke.etnier

If you create a variable in Process xaml inside a sequence the scope of the variable would be that sequence not Process. If you want that variable to be used in Process and sequence xaml give the scope as process it will be accessible for both sequence and process xaml. So it’s your wishful thinking.

Hope you understand!!

Hey @luke.etnier ,

UiPath Studio does not have a built-in setting to change the default scope of a new variable when created inside different activities or scopes. The default behavior is that when you create a new variable within a specific activity or scope (e.g., Sequence), the variable’s scope is set to that activity or scope by default.

Also you can use arguments in order to pass values from inner scope to outer scope

Hope it helps you out

Hi @luke.etnier

When you are creating the variable in a sequence the scope of the variable by default assigned to that sequence only.

If we want the scope of variable to main sequence we have to open variable panel and change it manually.

If created in the process xaml sequence, you want to change to main you have to change the scope manually in the variables panel.

Hope it helps!!

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