Cameron McKenzie
Cameron McKenzie

Reputation: 3920

How do you pass UiPath variables between sequences and workflows?

Variables in UiPath are visible only within the activity block in which they are declared, and they are definitely not visible in other workflows or sequences.

If I have a variable and I want to use that variable's value in another sequence or workflow, how do I access it?

Upvotes: 1

Views: 4369

Answers (1)

Cameron McKenzie
Cameron McKenzie

Reputation: 3920

Indeed, variable scope in UiPath is limited to the activity in which a variable is defined, and of course, the sub-activities nested within.

Pass Data with UiPath Arguments

To pass a variable from one sequence to the next, you must use UiPath arguments.

If you want to pass a variable from Sequence A to Sequence B, you configure an argument of the same data type in Sequence B using the Arguments tab, which is right next to the variables tab.

enter image description here

UiPath Argument Directions

There are three possible argument directions you can configure:

  • To pass a variable from Sequence A to Sequence B, sequence B will define an argument with an in direction.
  • To pass a variable from Sequence B to Sequence A, sequence B will define an argument with an out direction.
  • If you want to combine both, there is an in/out direction as well.

Map UiPath Arguments to Variable

With the argument is defined, the point where Sequence A invokes Sequence B will have an indicator that you must Import Uipath Arguments. Click on this button and map the argument defined in Sequence B to the variable used in Sequence A.

enter image description here

When you are finished, you will have successfully passed a UiPath argument from one sequence to another.

Upvotes: 2

Related Questions