Module-3 PPT Rpa
Module-3 PPT Rpa
Bangalor e -560060
Ranjitha J
Assistant Professor
Dept. of ISE
Bangalore.
MODULE-3
In this session Students will learn
➢Sequence
➢Flowchart
SEQUENCE
Example, we will make a simple project that asks for the name of the user and
then displays his or her response:
1. Open UiPath Studio and click on Blank to start a fresh project. Give it a
meaningful name. On the Designer panel, drag and drop a Flowchart activity from
the Activities panel.
2. Search for Sequence in the Activities panel and then drag and drop it into the
flowchart
3. Double-click on the sequence. We now have to add the steps that we want to
perform. Consider each step as an action. We can add many steps inside a
sequence- so in that will add two step – ask for the username in an input dialog,
display the username in a message box.
4. Search for input dialog in the search panel of the activities panel. Drag and drop
the input dialog activity inside the sequence.
5. Drag and drop a Message box activity into the sequence.
6. Next, create a variable and give it the desired name. this variable will receive
the text that the user has entered in the input dialog box in response to our
question that is, the user’s name:
7. We now have to specify the result property (in the properties panel) of the input
dialog box. On specifying the variable name there, it will receive the text that the
user entered.
8. Specify the variable name that we have created in the text area of the message.
9. Hit the run button and see the result.
FLOWCHART
1. Search for Flowchart in the same way that we have searched for the browser
activities in the Activities panel search bar. Drag and drop the Flowchart activity
inside the Designer panel.
2. The Flowchart appears in the Designer panel and we have a given Start node.
The Start node specifies where the execution begins.
3. We are ready to use different activities in our Flowchart. You can use any
activity/activities inside the Flowchart. For the sake of simplicity, let us just use a
Write line activity.
4. Drag and drop the Write line activity inside the Flowchart. Set its text property
by providing a string value. Connect this write line activity with the start node by
right-clicking on the write line avtivity and selecting set as start node.
EXAMPLE – 2- WHAT FLOWCHARTS ARE
AND WHEN TO USE THEM
The following steps:
1. First, add a flowchart from the activities panel into the designer panel.
2. Add a sequence activity within the flowchart.
3. Take two input dialog activities (for entering the number to be added) inside the
sequence activity.
4. Create the variables x and y to save the values.
5. Next, add a message box activity to perform a mathematical operation.
In our case, the sum of the two numbers is less than 20: x + y
6. Now, add a flow decision activity to check the mathematical operation.
7. If true, the flow decision will flow toward the true branch. Otherwise, it will flow towards
the false branch.
OUTPUT
CONTROL FLOW, VARIOUS TYPES OF LOOPS, AND
DECISION MAKING
1. Assign activity
2. Delay activity
3. Break activity
4. While activity
5. Do while activity
6. For each activity
7. If activity
8. Switch activity
1. The Assign activity- is used to designate a value to the variable. The Assign activity
can be used for different purposes, such as incrementing the value of a variable in a
loop, or using the results of a sum, difference, multiplication, or division of variables and
assigning it to another variable.
2. The Delay activity- as the name suggests, is used to delay or slow down an
automation by pausing it for a defined period of time. The workflow continues after the
specified period of time. It is in the hh:mm:ss format.
OUTPUT
EXAMPLE FOR DELAY ACTIVITY
For example of an automation that writes two messages to the Output panel with a delay of 50
seconds.
1. First, create a new Flowchart.
2. Add a Write line activity from the Activities panel and connect it to the Start node.
3. Select the Write line activity. Now, type the following text into the Text box: "Hey, what is your
name?".
4. Next, add a Delay activity and connect it to the Write line activity.
5. Select the Delay activity and go to the Properties panel. In the Duration field, set 00:00:50. This is
a 50-second delay between the two logged messages.
6. Take another Write line activity and connect it to the Delay activity. In the Text field, write "My
Name is Hello”.
After clicking on the Run button, the Output panel shows the message that delays it by 50 seconds:
3. The Break activity- is used to break/stop the loop at a particular point, and then continue to
the next activity according to the requirement. It cannot be used for any other activity apart
from the For each activity.
In this example, we will use the Break activity to execute only one iteration.
1. Add a Sequence activity to the Designer panel.
2. Next, add a For each activity inside the Sequence.
3. Create two variables; an integer variable named item, and an array integer variable named x.
Then, set them to the text field.
4. Now, assign a default value to the integer variable x.
5. Add a Break activity inside the body of the loop.
6. Under the For Each activity, add a Write line activity.
7. In the Write line activity, type item.ToString in the text field.
8. When we click the Run button, it will display one element, as shown in the
figure. This is due to the break activity.
4. While activity - The While activity is used in automation to execute a statement
or process based on a certain condition. If found true, the loop is executed; that is,
the process is executed repeatedly.
In the following while example, we will see how an integer variable will increase
from 5 to 50 in increments of 5.
1. On a Blank project, add a Sequence activity.
2. Now, create an integer type variable x. Set its default value to 5.
3. Next, add a While activity to the Sequence.
4. In the condition field, set x<50.
5. Add an Assign activity to the body section of the While loop.
6. Now, go to the Properties panel of the Assign activity and type in the text field integer
variable for value field integer x+5.
7. Drag and drop a Write line activity and specify the variable name x and
apply ToString method
8. Now, click the Run button. The output will display in the output panel, as shown in the
following:
5. The Do while activity- is used in automation when it is required to execute a statement based
on the fulfillment of a certain condition. How it differs from the While activity is that it executes a
statement, then checks whether the condition is fulfilled.
An example to understand how the Do while activity works in automation. Take an integer
variable.Starting with this variable, we shall generate all multiples of 2, less than 20.
OUTPUT
6. The For each activity- works by iterating each element from the collection of items or list of
elements, one at a time.
In the following example, we shall use the For each activity to go through a collection of even
numbers and display each element one at a time.
OUTPUT
1. Start with a Blank project in UiPath.
2. Add a Sequence activity to the Designer panel.
3. Next, add a For each activity within the Sequence and create an integer type array variable, x
4. In the default value of the variable, put in ({2,4,6,8,10,12,14,16,18,20}).
5. Add a Write line activity to the Designer Panel (this activity is used to display the results).
6. In the Text field of the Write line activity, type item.ToString to display the output: Now run
the program.
7. The If activity- consists of a statement with two conditions: true or false. If the statement is
true, then the first condition is executed; if not, the second condition is executed.
Example that checks whether the sum of any two numbers is less than 6.
OUTPUT
1. Add a Flowchart from the Activities panel.
2. Add two Input dialog activities. Create two integer variables, x and y.
3. In the Properties panel, change the label name and title name of both
the Input dialog activities.
4. Now, specify these name of these two variables in the Result property of both
the Input dialog activities.
5. Now add the if activity to the designer panel:
6. In the condition part, x + y < 6, check whether it is true or false. Add two write
line activities and type” True” in one end and “False” in the other:
8. The Switch activity can be used to make a choice. When we have various
options available and want to execute one option, we frequently use the Switch
activity.
Example where we have to check whether a given number is odd or even.
output
1. Add a Sequence activity.
2. Add an Input dialog activity inside the Sequence.
3. Now, create an integer type variable k.
4. Specify the newly created variable's name in the Result property inside
the Properties panel.
5. Add the Switch activity under the Input dialog activity.
6. In the Expression field, set k mod 2 to check whether the number is divisible by 2 or not.
7. Add a Write line activity to the Default section and type the k.toString +”is an even
number” in the text field.
8. Now, create case 1, add the one other write line activity to it, and type k.ToString +”is
an odd number” in the text field:
HOW TO USE A FLOWCHART
Consider an array of names. Say we have to find out how many of them start with
the letter a. We will then create an automation where the number of names
starting with a is counted and the result is displayed.
ADD A MESSAGE BOX
INSIDE THE
SEQUENCE ACTIVITY
OUTPUT
1. Drag and drop a Flowchart activity from the Activities panel.
2. Drag and drop a Sequence activity inside the Flowchart. Connect the Sequence
to the Start node by right-clicking on the Sequence activity and selecting the Set
as Start node option.
3. Double click on the sequence activity. Create a variable. Give it a name (in our
case, will create an array of type string and name the variable as names). Set the
variable type to array of[T]. when asked for the type of array, select string. Also,
initialize the array in the default section of the variable by giving it a default
values. For example, {“John”, “Andrew”, “Anita”}.
4. Create a variable of type integer count for storing the result. Set the variable
type to Int32
5. Drag and drop a for each activity inside the sequence. Also, specify the array
name in the expression box of the for each activity. The for each activity is used to
iterate over the array each time until it reaches the end.
6. Drag and drop the if activity from the activities panel and place it inside the for
each activity at the location where drop activity here is mentioned. Specify the
condition in the expression box of the if activity. The if activity is used to to check
for a particular condition/expression. If that expression is satisfied, the then block
will be executed. Otherwise, the else block will be executed. Here specify the
expression as item.ToString.StartWith (‘a’). This expression specifies the name
present in the item variable starts with the letter ‘a’. The for each activity iterates
over the array, picks up one name at a time, and stores it as a variable, item.
7. Now, we are going to use the count variable and increment it each time a name
from an array starts with the letter a. for this, we have to use the A + B assign
activity. Drag and drop the A + B assign activity inside the if activity. Set the To
property to count (variable name) and the value property to count+1 (to
increment its value) of the A + B assign activity.
8. Just drag and drop a message box activity inside the sequence activity. Specify
the count variable in the expression box of the message box activity. But
remember, the variable that have created is of type int32, so, it cannot be used
with the message box activity without converting it to a string. To convert it to a
string, we have the ‘.toString’ method available in Uipath studio. Just apply it to
the variable and select ‘.toString’
THANK YOU
CHAPTER - 4
In this session Students will learn
➢Variables
➢Collections
➢Arguments
➢Building Data Table
VARIABLE & SCOPE
MEMORY - consists of millions of memory Cells and each memory cell stores data in the form of 0s
and 1s (binary digits). Each cell has a unique address, and by using this address, the cell can be
accessed.
VARIABLES
There are different types of variables. Variables can be classified into three categories:
• Scalar: These are variables that can only hold a single data point of a particular data type, for
example: Character, Integer, Double, and so on.
• Collections: These are variables that can hold one or more data point of a particular data type. For
example; array, list, dictionary, and so on.
• Tables: These are a tabular form of the data structure which consists of rows and columns.
VARIABLE EXAMPLE
Create a variable and then displaying a message box using that variable:
OUTPUT
COLLECTION- ARRAY EXAMPLE
This example, we are going to take anarray of integers, initialize it, and then iterate through all the
elements of the array.
OUTPUT
1. Drag and drop a Flowchart activity onto the main Designer panel, and drag and drop a
Sequence activity inside the Flowchart. Set the sequence as Start node.
2. Create a variable in the Variables panel and give it a meaningful name (in this example,
we have created a variable named arr, which is an array of integers). Choose the data type
as an array of integers.
3. Initialize the array as {1,2,3,4,5} in the Default section. You can initialize it with the int32
data type.
4. Drag and drop a For each activity from the Activities panel inside the Sequence, and
drag and drop a Message box activity inside the For each activity.
5. Specify the array name in the expression text box of the For each activity.
6. Specify the item variable that is auto-generated by the For each activity, inside the
Message box activity. We have to convert the item variable into the String type because
the Message box activity is expecting the string data type in the text box. Just press the
dot (.) along with the item variable and choose the ToString method.
ARGUMENTS
A data table is a tabular form of data structure. It contains rows and each row has
columns, for example:
BUILDING A DATA TABLE
CurrentRow("name").ToString +"-"+ CurrentRow("rollno").ToString +"-"+ CurrentRow("class").ToString
output
BUILDING A DATA TABLE
1. Drag and drop a Flowchart activity on the Designer panel. Also, drag and drop a Sequence activity and
set it as the Start node.
2. Double click on the Sequence and drag and drop the Build Data Table activity inside the Sequence
activity.
3. Click on the Data Table button. A pop-up window will appear on the screen. Remove both the columns
(auto generated by the Build Data Table activity) by clicking on the Remove Column icon
4. Add three columns by simply clicking on the + symbol. Specify the column names and select the
appropriate data types from the drop-down list. Click on the OK button. We will add column Name of String
Data Type, Roll_No of Int32 type and finally Class of String type: Now enter some values just to insert the
data into the rows. Click on the OK button and our data table is ready. We have to iterate over the data
table's rows to make sure everything works correctly.
5. In order to store the Data Table created by Build Data Table activity, we have to create a data table
variable data of DataTable type and in order to store the result of the data table that we have dynamically
built. Also, specify assign the Output property of the Build Data Table activity with this variable. Specify the
data table variable's name there.
6. After our data table is ready, we will iterate the data table's rows to make sure everything
works correctly. Drag and drop the For each row activity from the Activities panel inside the
Sequence activity. Specify the data table variable's name (data) in the expression text box of the
For each row activity
7. Drag and drop a Message box activity inside the For each row activity. In the Message box
activity, Inside the message box we have to write following string: row(“Name”).ToString+”- “+
row(“Roll_No”).ToString+”-“+ row(“Class”).ToString. row is the variable which holding data
for the data row in each iteration This row variable contains all the columns of a particular row.
Hence, we have to specify which column value we want to retrieve by specifying the column
name. Instead of the column name, we can also specify the column index.
Hit the Run button to see the result
BUILDING A DATA TABLE USING DATA
SCRAPPING (DYNAMICALLY)
output
CLIPBOARD MANAGEMENT
output
READ RANGE
output
WRITE RANGE
output
APPEND RANGE
data1
output
STEP BY STEP EXAMPLE – READING AN EXCEL FILE &
CREATING A DATA TABLE BY USING DATA FROM EXCEL
output
STEP BY STEP EXAMPLE – CREATING A DATA
TABLE & THEN WRITING ALL ITS DATA TO AN
EXCEL FILE
output
THANK YOU