RPA Unit4
RPA Unit4
methods too.
1. Drag and drop a Flowchart activity on the main Designer panel. Also, drag and
drop an Excel application scope inside the Flowchart. Connect it to the Start node. Double click
on Excel application scope.
2. Drag and drop the Read Cell activity inside the Excel application scope activity.
Specify the range value in the cell text box of the Read Cell activity.
Create a variable of type string to hold the result produced by the Read Cell activity.
In our case, we have created a Result variable.
Specify the Output property of the Read Cell activity by providing the variable's name that we
have created:
3. Drag and drop a Message box activity inside the Excel application scope activity
and specify the string variable's name (which we created earlier) in the
expression box of the Message box activity.
1. Drag and drop a Flowchart activity on the main Designer panel. Also, drag and drop an Excel application
scope inside the Flowchart activity. Connect it to the Start node.
2. Drag and drop a Write Cell activity inside the Excel application scope. Specify the cell value in which we
want to write in the Range property of the Write Cell activity. Also, specify the value of the Value property:
Press F5 and see the result. Open the Excel file to see the changes:
This is used to read the value up to the specified range. If the range parameter is not
specified, it will read the entire Excel file:
1. Drag and drop a Flowchart activity on the main Designer panel. Also, drag and drop an Excel
application scope inside the Flowchart activity. Connect it to the Start node.
2. Drag and drop a Read Range activity inside the Excel application scope activity.
The Read Range activity produces a data table. We have to receive this data table in order to
Consume it. We need to create a data table variable and specify it in the Output property of the Read
Range activity.
3. Drag and drop an Output Data Table activity inside the Excel application scope activity. Now, we
have to specify two properties of the Output Data Table activity: Data Table property and text property.
The Data Table property of the Output Data Table activity is used to convert the data table into a string
format. The text property is used to supply its value in a string format. We have to receive this value in
order to consume it. For this, let us create a variable of type string. Give it a meaningful name (in our case,
it is Result):
That's it. Press F5 to see the result. A window will pop up displaying your Excel file data.
This is used to write a collection of rows into the Excel sheet. It writes to the Excel file in the
form of a data table. Hence, we have to supply a data table:
1. Drag and drop a Build data table activity from the Activities panel.
Double-click on this activity.
A window will pop up.
You will notice that two columns have been generated automatically. Delete these two columns.
Add your column by clicking on the + icon and specify the column name.
You can also select your preferred data type.
You are free to add any number of columns:
4. Specify the data table variable name that we created earlier and set it as a Data table property inside the
Write Range activity.
We can also specify the range. In this case, we have assigned it as an empty string:
That's it. Hit the Run button or press F5 to see the result.
1. Drag and drop the Flowchart activity on the main Designer window. Also, drag
and drop the Excel application scope inside the Flowchart activity.
Connect it to the Start node.
In this program, we are going to use another sample Excel file, which has some raw data. Then, we
will read this Excel file and append the data to another Excel file.
Specify the Excel file path in the Append Range activity (in which we
want to append the data).
Also, specify the data table (which is generated by the Read Range activity):
We can clearly see that the data has been appended successfully to the Excel sheet.
We will see how to extract data from an Excel file into a data table and vice
versa. We will achieve this by:
Reading an Excel file and creating a data table using data from the Excel file
Creating a data table and then writing all its data to an Excel file.
4.7.1 Reading an Excel file and creating a data table by using data from the Excel file
We have an existing Excel file and we are going to use it in our project:
1. Drag and drop the Flowchart activity on the main Designer window. Also, drag
and drop the Excel application scope inside the Flowchart.
2. Double-click on the Excel application scope. You have to specify the path of your
workbook/Excel file. Drag and drop the Read Range activity from the Activities
panel inside the Excel application scope.
The Read Range activity will read the entire Excel sheet. We also have the option
of specifying our range. Create a variable of type data table and specify it in the
Output property of the Read Range activity. This variable will receive the data table
produced by the Read Range activity:
4. Drag and drop a Message box activity inside the Excel application scope
activity.
Also, specify the string variable's name that we created earlier inside the
Message box activity.
That's it. Press F5 to see the result. A window displaying the Excel file data will pop up.
we will build a data table dynamically and then write all its data to an Excel
file:
1. Drag and drop a Build data table activity from the Activities panel. Double-click
on this activity. A window will pop up. Two columns have been generated
automatically; delete these two columns. Add your column by clicking on the
+ icon and specify the column name. You can also select your preferred data type.
You are free to add any number of columns:
In this project, we are adding two columns. The procedure for adding the second column is almost the
same. You just have to specify a name and its preferred data type. We have added one more column (Roll) and set
the data type to Int32 in the data table. We have also initialized this data table by giving some values to its rows.
Create a variable of type Data Table. Give it a meaningful name. Specify this data
table's name in the Data Table property of the Build data table activity. We have
to supply this variable in order to get the data table that we have built:
Specify the Excel sheet's path or manually select it. Connect this activity to the
Build Data table activity:
3. Inside the Excel application scope activity, drag and drop the Write
Range activity.
Specify the data table variable name that we created earlier and set it as a
Data table property inside the Write Range activity.
We can also specify the range. In this case, we have assigned it as an empty string:
4. That's it. Hit the Run button or press F5 to see the result.
Module 4
Extraction is a primary feature of RPA, enabling UI automation. Behind the scenes, many
technologies are at work on the seamless extraction of information from the UI. When typical
RPA techniques are not successful, OCR technology is used to extract information. We will
learn about using OCR and other techniques in the following topics:
a.Screen Scraping
b.When to use OCR
c.Types of OCR available
d.How to use OCR
It is also auto-generated when we record actions using the Basic or Desktop recorder.
In this example, we shall use the Attach Window activity manually. Here, we are going to
attach a Notepad window and then write some text into it:
5. Double-click on the Attach Window activity. Click on Click Window on Screen and
indicate the Notepad window. The Notepad window is now attached to the previous activity:
6.For the sake of completeness, we are going to add a Type into activity.
Just drag and drop the Type into activity, inside the Attach Window activity.
Click on the Indicate element inside window and
Locate the Notepad window where you want to write the text.
Write the text in the Text property of the Type into the activity.
7. Hit the Run button.