How to deal and work with variables and arguments in UiPath

Last updated on Jan 15 2023
Neha Goyal

Table of Contents

How to deal and work with variables and arguments in UiPath

In this blog, allow us to understand the way to deal and work with variables and arguments in UiPath, and therefore the concepts involved.
Managing Variables in UiPath Studio
Variable could also be defined because the symbolic name related to a worth which will change. In UiPath studio variables are of various types and are wont to store multiples sort of data starting from generic value, text, number, data table, time & date.
One important use of variables is that we will control the amount of times the body of a loop is executed because the worth of variables can change.
The Variable Panel
As the name suggests, the variable panel is employed to form variables and enables us to make changes to them. the subsequent screenshot will give an insight about the variable panel −

RPA 16
RPA

In the above screenshot, you’ll notice that there are four fields namely Name, Variable Type, Scope and Default within the variable panel.
The four fields are explained as given below −
Name
It is a compulsory field. We must need to provides a name to the variable. Suppose if you’re not giving any name, then UiPath studio will generate one automatically. it’s recommended that we follow naming conventions, as discussed within the previous chapter, while naming a variable.
Variable Type
It is also a compulsory field which enables us to settle on the sort of variable. we will choose among the options: Boolean, Int32, String, Object, Generic Value, Array of [T] and Browse of Types from the Property panel itself. If you are doing not choose any type, UiPath studio will consider it as a string.
Scope
It is also a compulsory field which shows the world during which the variable is out there. for instance, if you select the activity type Sequence then the scope of the variable would be Sequence then on.
Default
It is an optional field which shows the default value of a variable. for instance, the default value for a variable of type Int32 is 0.
Types of Variables
The following are the kinds of variables that we will use in UiPath Studio.
• Text variables − because the name suggests, such sort of variables can store only strings. for instance, if you would like to store information like name, lastname, usernames etc., then text or string variables is that the option you’ve got to settle on.
• Boolean variables − These also are called True or False variables. it’s only two possible values: true or false.
• Integer variables − As name suggests, such quite variables can store only integer or Int32 values i.e. integer information. they’re also called Number variables.
• Array variables − If you would like to store multiple values of an equivalent type then the array variable would be suitable. you’ll store as many sorts of arrays as there are sorts of variables in UiPath.
• Date and Time variable − because the name suggests, this type of variable enables us to store information about any date and time.
• Data Table variables − These sorts of variables store big piece of data. It acts as a database or spreadsheet with rows and columns. for instance, if you would like to extract information from an internet site and need to store it during a spreadsheet, then you’ll choose data table variable.
How to Create Variables?
Once you select a minimum of one activity within the designer panel of UiPath studio, you’ll create a variable with the assistance of the subsequent two methods −
• By using option from Context menu − As you recognize after right-clicking the activity, the context menu appears. From this context menu you’ll choose the choice Create Variable. the subsequent screenshot will give insight of this −

RPA 17
RPA

• By using Variable Panel − differently to make a variable is Variable Panel. First, we’d like to click on variable panel from the designer tab. Then variable panel would be displayed. Now, click create variable line to make a replacement variable. The variable panel has already been discussed intimately within the previous section.
How to Remove Variables?
We can also delete the variables we’ve created within the previous section, using any of the subsequent two methods −
Method 1
Go to variable panel and right click the variable you would like to delete. After clicking the “Delete” option, you’ll delete the chosen variable.
Method 2
Go to variable panel and choose the variable you would like to delete. Now press delete button from keyboard and therefore the selected variable are going to be deleted.
Managing arguments in UiPath Studio
Arguments, resembling variables, are wont to pass data from one workflow to a different. they will store data dynamically and pass it on. One difference between variable and argument is that variables pass data to other activities while arguments pass data to other workflows.
In UiPath studio, arguments are of various types hence we will create differing types of arguments like Generic value, text, number, data table, object, Boolean. a crucial point about arguments is that they need specific directions that tell the appliance where the knowledge stored is meant to travel. The directions are often In, Out, In/Out, Property.
The Argument Panel
As the name suggests, the argument panel is employed to form arguments and enables us to make changes to them. the subsequent screenshot gives an insight about the argument panel −

RPA 18
RPA

In the above screenshot, you’ll notice that there are four fields namely Name, Direction, Argument Type and Default within the variable panel. the subsequent is that the explanation about them −
• Name − it’s a compulsory field. We must need to provides a name to the argument. Suppose if you’re not giving any name then UiPath studio will generate one automatically. it’s recommended that follow naming conventions, discussed in previous chapter, while naming an argument.
• Direction − it’s also a compulsory field which enables us to pick a direction for our argument. we will choose between following four quite directions −
o In − This direction means the argument can only be used within the given workflow.
o Out − This direction means the argument are often wont to pass data outside the given workflow.
o In/Out − This direction means the argument are often used within and out of doors the given workflow.
• Property − This direction isn’t in use currently.
• Argument Type − it’s also a compulsory field which enables us to settle on the sort of argument. we will choose among the choices Boolean, Int32, String, Object, Generic Value, Array of [T] and Browse of Types from the Property panel itself. If you are doing not choose any type, then UiPath studio will consider it as a string.
• Default − it’s an optional field which shows the default value of an argument.
How to Use an Argument?
Let us take an example to know how we will use arguments.
Example
In this example, we’ll create two separate sequences: one for assigning a worth to an argument and therefore the other for invoking it and displaying the worth during a message box.
We need to follow the subsequent steps to implement this −
Step 1 − Drag & drop a sequence within the UiPath studio designer panel.
Step 2 − Click Arguments panel and make new argument say InputValue of String type having Out direction.
Step 3 − Now, drag & drop an Assign activity to the designer panel.
Step 4 − we would like to offer the worth to Assign activity same because the value of InputValue argument. For this purpose, attend the Properties Panel of Assign activity and write InputValue within the To field.
Step 5 − Next, write any message say “Example of using an argument!!” within the Value field under Properties panel of Assign activity.
Till now, this implementation will appear as if as follows −

RPA 19
RPA

Step 6 − Next, under the planning tab from New sink menu choose new Sequence for designer panel.
Step 7 − For this create a replacement variable named strOutputValue by clicking on the variable panel.
Step 8 − Now, drag & drop an Invoke Workflow File activity to the Designer panel.
Step 9 − Next, browse for previously created sequence by clicking on the Browse (…) button on Invoke Workflow File activity.
Step 10 − we would like to import the arguments during this activity. Hence click the Import Arguments button. it’ll open Invoke Workflow’s Arguments window. Now in its Value filed add strOutputValue variable and click on OK button.
In this way the worth from it’ll be stored within the current project through strOutputValue variable. It are often seen within the following screenshots:

RPA 20
RPA
RPA 21
RPA

Step 11 − Next, add Message Box activity under Invoke Workflow File activity to the Designer panel and write a message “Thanks” in its text field.
Step 12 − Press Run(F5) button and it’ll give following output −

RPA 22
RPA

So, this brings us to the end of blog. This Tecklearn ‘How to deal and work with variables and arguments in UiPath’ blog helps you with commonly asked questions if you are looking out for a job in Robotic Process Automation. If you wish to learn RPA and build a career in Robotic process Automation domain, then check out our interactive, Robotic Process Automation using UiPath Training, that comes with 24*7 support to guide you throughout your learning period. Please find the link for course details:

https://www.tecklearn.com/course/robotic-process-automation-using-uipath/

Robotic Process Automation using UiPath Training

About the Course

Tecklearn’s Robotic Process Automation training using UiPath will prepare you for UiPath’s RPA Developer Advanced Certification Exam so that you can drive RPA initiatives in your organization. RPA training and certification is a comprehensive course for mastering Robotic Process Automation, different tools in RPA, the life cycle of RPA, deploying the UiPath tool, UiPath Studio, invoking a UiPath workflow, Citrix automation, automating the virtual environment and more through hands-on projects and case studies.

Why Should you take Robotic Process Automation using UiPath Training?

• The average salary of RPA Technical Automation Architect is $116,872 per annum – Indeed.com.
• Robotic Process Automation market will reach $2.9 billion by 2021 – Forrester Research
• Robotic Process Automation is being heralded as one of the booming industries in today’s digitally-driven economy. Every industry including banking, finance and information technology can immensely benefit from the RPA industry

What you will Learn in this Course?

Introduction to Robotic Process Automation
• Why RPA?
• Industry Implementation of RPA
• RPA Growth Trends
• Different RPA Tools
• Types of Bots
• Why UiPath?
• UiPath Installation
• Getting Started with UiPath
• Project and Project Types
• UiPath Dashboard
• UiPath Overview
Important components of UiPath
• Introduction to UiPath Studio, UiPath Robot and UiPath Orchestrator
• Working with variables
• Managing control flow
• Excel Automation
• Gmail automation with UiPath
More about RPA
• Ui Path Studio Components
• Passing Value from one task to another in Ui Path
Programming, Debugging and Exception Handling
• Programming Activities in UiPath
• Debugging errors in a UiPath Project
• Different ways of Error Handling in UiPath
• Browse through the log files related to UiPath Project
Connect Orchestrator with UiPath
• UiPath Orchestrator Overview
• Orchestrator activities
RPA Tools like REFramework
• Introduction to REFramework
• Purpose of REFramework
• Using State Machine Layout
• State Machine States
• Workflows Involved
• Exception Handling and Logging
Programming Activities Using Data Table
• Programming activities using Data Table
• Learn Data Table Structure, Comprehend Searching Method and Data Table Activities
• Create an environment and associate the workflow
• Creation of Collection
• Email Automation
• Understanding Sequence and Flowchart
• Automate Sending and Reading of Email Message
Data Scrapping
• Importance of Data scraping with UiPath
• Data scraping aspects: Taking screenshot, Activating, getting text, highlighting and selecting item, loading image and more
Desktop Automation
RPA Project
• Excel Operations Automation using Ui Path
UiPath Orchestrator
• Orchestrator Overview
• Orchestrator Account Creation
• Connecting a Robot
• Create an Environment and Associate the Robot
• Publish a Package
• Create a Process from the Package
• Running a Robot and Examine Logs
• Scheduling and Running of Unattended Robot

0 responses on "How to deal and work with variables and arguments in UiPath"

Leave a Message

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