HomeUiPath

How to create variables in UiPath – RPA – Robotic Process Automation

How to create variables in UiPath – RPA – Robotic Process Automation
Like Tweet Pin it Share Share Email

When working with automation of complex end to end business processes, it is inevitable that you need to capture values from one part of the process and use it at another place. Which means you need to store value in a variable so that you can use it different other parts of the process. So in this article you will learn How to create variables in UiPath. You would also be introduced to some of the most commonly used variables.

Different types of variables in UiPath

There are huge number of types of variables that you can create in UiPath studio, each of the type can store different type of value. Some of them are stated below

  • String – Stores values of type strings in this type of variable ( ex: “sample string”,”username”,”Hello Everyone” )
  • int32  – Stores values of type integer in this type of variable ( ex: 1,3,5, etc.. )
  • Boolean –  Stores values of type boolean in this type of variable  ( ex: true / false )
  • Object – Stores values of type of object.
  • Array[T] , where T is any type of variable

Variable types shown above are not the complete list of variables, you can click on “Browser for Types …” and UiPath studio shows a popup with huge list of variable types that it can support

Steps How to create variables in UiPath studio

  • When you are working in an UiPath project.
  • Click on variables tab present at the bottom of UiPath studio.
  • It will expand the variables tab, this tab contains the list of all variables that are required for this specific project.
  • Click any activity available in the “Design Area” and you would see the list of variables in the variables tab as below
  • Click on “Create Variable” to create a new variable and enter a name you want to give, say “username”
  • By default the Variable type is “String”, you can click on the String and UiPath shows the list of types that you can chose from.
  • That’s it you are done with creating a variable in UiPath’s variable tab.
  • You can further use this variable name in different activities of the project.

Two other important columns in Variables tab

“Scope” and “Default” columns also play a specific role when working with Variables in UiPath studio.

  • Scope: The default scope is “Sequence”, when we work with complex projects, you might be having different sequences, flow chart etc.. in that case you can select the desired scope accordingly.
  • Default: In case you want to give a default value for a variable, you can provide the value in this column, that is in case your variable was never assigned or modified in the sequence, it will still hold a default value and it can be used with the default value it self.

 

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *