0% found this document useful (0 votes)
181 views

U I Path Material

Uploaded by

E.T.克 יהןה
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
181 views

U I Path Material

Uploaded by

E.T.克 יהןה
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 308

OFFICIAL (CLOSED) \ NON-SENSITIVE

goRPA Program: UiPath

Republic Polytechnic

Discover. Transform. Achieve


Copyright of Republic Polytechnic
OFFICIAL (CLOSED) \ NON-SENSITIVE

Course Material

• Course Material can be downloaded from https://bit.ly/3nOU65o

• GoRPA UiPath Useful Links document contains weblink and


resource for hands-on exercises. Please make sure you download
the word document and save it on the training laptop

Note: this course was created using UiPath Studio 2021.6.0-beta.4514. Some elements may be different in
2
the latest Community Edition version.
OFFICIAL (CLOSED) \ NON-SENSITIVE

Trainers Introduction

3
OFFICIAL (CLOSED) \ NON-SENSITIVE

Participants

4
OFFICIAL (CLOSED) \ NON-SENSITIVE

goRPA Program

Training: 2 day Facilitation: 1.5 day

goRPA

Completion report
(last session)
OFFICIAL (CLOSED) \ NON-SENSITIVE

2 Day goRPA Training Schedule

Day 1 Day 2
Morning Morning
Introduction of RPA and UiPath Handling and filtering data files

Reading excel and pull data from


website

Afternoon Afternoon

Scripting table data from the website Email Automation

Variables and Exception Handling UiPath Robot and Orchestrator

Debugging First use case discussion

6
OFFICIAL (CLOSED) \ NON-SENSITIVE

Housekeeping

• Class times
– 9:00 to 17:00, 1 hour lunch
• Food
– No drinks + food in class room, just water
• Washroom
– Water cooler
• Interaction
– Ask! Share!
– Help each other
• Wear mask
7
Introduction to Robotic Process Automation
(This topic will take about 15 mins)

8
OFFICIAL (CLOSED) \ NON-SENSITIVE

Advantages of Robotic Process Automation?

9
OFFICIAL (CLOSED) \ NON-SENSITIVE

Advantages of Robotic Process Automation

Productivity Scalability
Efficiency Complete work faster
and with less manpower
Able to instantly ramp
up and scale down

Consistency Accuracy

Quality Routine task are The right result,


performed the same way decision, or calculation
each and every time the first time

Improve Employee Customer

Service Morale
Free up human
resources for higher
Experience
Customising
communication and
value tasks faster response

Source: Govtech for WoG RPA Playbook 10


OFFICIAL (CLOSED) \ NON-SENSITIVE

What Is Robotic Process Automation (RPA)?

Software application
which has the
Robotic capability to mimic
human actions

A sequence of steps
Process leading to a meaningful
task

A RPA robot

Automation Processing task


automatically

11
OFFICIAL (CLOSED) \ NON-SENSITIVE

Handling Data for Repetitive Tasks

12
OFFICIAL (CLOSED) \ NON-SENSITIVE

Where to Implement RPA?

Rule or criteria based

Manual, repetitive and data intensive

Across multiple systems

13
Introduction to UiPath
(This topic will take about 10 mins)

14
OFFICIAL (CLOSED) \ NON-SENSITIVE

RPA landscape (Forrester)

The Forrester Wave™:


UiPath continues market expansion
around the globe. This RPA Leader
has invested heavily in expanding its
range of products to maximize the
value that automation brings its
customers.

https://www.uipath.com/resources/automatio
n-analyst-reports/forrester-wave-rpa

15
OFFICIAL (CLOSED) \ NON-SENSITIVE

RPA landscape (Gartner)

Gartner Magic Quadrant RPA (2020):

“The RPA market is rapidly growing as


incumbent vendors jockey for market
position and evolve their offerings. [...] In
the second year of this Magic Quadrant,
the bar has been raised for market
viability, relevance, growth, revenue and
how vendors set the vision for their RPA
offerings in a fluid market.” (2020
Gartner Magic Quadrant for Robotic
Process Automation)

https://bit.ly/39O4yTA

16
OFFICIAL (CLOSED) \ NON-SENSITIVE

Why UiPath?

• Fast implementation
– Easy development
– Fast running speed
– Flow chart based design
• Reusability
– Reuse at the workflow level
– Use different packages for different purposes
• Extensibility
– support third-party packages as extension
– support Microsoft .Net framework (VB / C#)
– you can design your own packages as reusable libraries
• Scalability with Desktop and Enterprise level automation

17
OFFICIAL (CLOSED) \ NON-SENSITIVE

UiPath Products

18
OFFICIAL (CLOSED) \ NON-SENSITIVE

Versions of UiPath

• UiPath Community Cloud Edition is free for


– open source projects,
– academic research,
– education,
– small professional teams
– companies with less than US$5 million revenue

• 60-day trial Enterprise Version with full functions


– Studio Edition
– Enterprise Cloud Edition
– Enterprise Server Edition

https://www.uipath.com/start-trial 19
• Your job requires you to get the
latest currency converting result
Use Case 1:
from the following website.
Currency Converter https://forex.asiaone.com/

(This topic will take about 50 mins) • You have structured input data
(Amount, From Currency, To
Currency) in an Excel form.

20
OFFICIAL (CLOSED) \ NON-SENSITIVE

Install Edge Extension

• In UiPath, go to StartTools
• Click Edge to install Browser extension

21
OFFICIAL (CLOSED) \ NON-SENSITIVE

UiPath Edge Extension

22
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC1 - Approach

Start
• Phase 1
Using UiPath recording feature, we Type Amount
capture the process of one query
Select From
Currency
• Phase 2
Read any number of data record from Select To currency

Excel file and search currency


conversion result. Submit

End

23
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC1 - Approach to Phase 1

1. Open currency conversion website in Start

Edge browser
Open browser
2. Open UiPath Studio
3. Create a new project
Attach browser
4. Add a Flowchart
5. Record the steps
Convert currency
6. Play the recorded steps
End

24
OFFICIAL (CLOSED) \ NON-SENSITIVE

Hands-on Use Case 1 – Convert Currency

3
25
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

• In UiPath Studio Design Panel,


– Click “Open Main Workflow”

Click Open Main


Workflow

26
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency
• In UiPath Studio (Activities panel),
– Search Flowchart
– Double click

27
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency
• In the Design tab, click 

28
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

• Click

29
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

• Click the Convert input field

Click the box with light


blue background

30
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

• Check Empty field  Type 100 Then press Enter


key

1
31
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

• If you need to scroll down the page without robot capturing that
scrolling process.
• Press F2
• F2 function will pause the robot from capturing for 3 seconds

32
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency
• Click From: field, select “Australian Dollar (AUD)”
• Click OK

3
33
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency
• Click To: field, select “Canadian Dollar (AUD)”
• Click OK

3 34
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency
• Click Submit button

35
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

• Press Esc key to stop recording


(another way to stop recording is to Right-click using your
mouse)
• Click button

36
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

• Link Start with Web

Draw a connector here or


right click Set as Start
Node

37
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

• Click to run this use case

Default start:
Debug File

38
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency
• Let’s review the workflow
Attach Browser page
1

39
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC1 - Deeper look

• How does UiPath know which textbox to use?

• Click on the settings and


select Edit Selector

• UiPath shows the


parameters of the selected
UI Element

40
OFFICIAL (CLOSED) \ NON-SENSITIVE

Selectors

• app and title are fixed


in the Attach Browser activity

• tag=“INPUT” indicates unique


data entry location

41
OFFICIAL (CLOSED) \ NON-SENSITIVE

Link with Attach Browser

• Attach Browser has a selector

• All activities in Attach Browser


will inherit this selector

• Attach Browser is a container

42
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

• Ensure that the Properties


panel of Type
Into, SimulateType is false or
uncheck

• SimulateType does not


rely on keyboard
driver, it provides faster
way of performing type
actions and some application
might not support
this interaction type.

Uncheck SimulateType 43
OFFICIAL (CLOSED) \ NON-SENSITIVE

Automatic Recording Types

Type When to use


Web Browser applications, activities are places in
attach browser

Basic Short recordings, does not generate container,


slow execution

Desktop Desktop applications, activities are places in


attach window

Other specialized Recording Types include: Image, Native Citrix, Computer Vision 44
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

What if we
want to
record a
right-click?

45
OFFICIAL (CLOSED) \ NON-SENSITIVE

Automatic Recording VS Manual Recording


Automatic recording will record:
• Left-click on windows, buttons, check boxes, drop-down lists etc.
• Text typing
https://docs.uipath.com/studio/docs/automatic-recording

Manual recording/Single actions will record:


• Keyboard shorts
• Modifier keys
• Right-click
• Mouse hover
• Getting text
• Find elements and images
• Copy to Clipboard
https://docs.uipath.com/studio/docs/manual-recording 46
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

What happens if
AsiaOne website is
not opened when
we run the bot?

47
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Selector Not Found

• Selector cannot be found


• By default 30 seconds

• Can change value using activity properties

48
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

Do we have
to open the
AsiaOne
website
manually?

49
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

Search Open
1

2
Drag Open Browser to
the design panel

50
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

Click Double-
click to view

51
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency
Type URL with double inverted commas,
“https://forex.asiaone.com/”

1 2

Select BrowserType to Edge


52
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

• Link Open Browser and Web

53
OFFICIAL (CLOSED) \ NON-SENSITIVE

What Have You Learnt

• Link UiPath with Edge


• Use web recording to create a sequence
• Understand selectors
• Use the following activities:
– Flowchart
– Open Browser
– Attach Browser
– Type Into
– Select Item
– Click
54
OFFICIAL (CLOSED) \ NON-SENSITIVE

55
OFFICIAL (CLOSED) \ NON-SENSITIVE

Recap

• Phase 1
Using the UiPath recording feature, we capture the
process of currency conversion

• Phase 2
Read any number of currency conversion transaction
request from Excel and search the result

56
OFFICIAL (CLOSED) \ NON-SENSITIVE

Approach to Phase 2

• Read data from excel Start

• Open browser Read data


from excel
• Attach browser Open
• For each row in Data Table browser

– Type into Amount Attach


browser
– Select From currency
For Each row
– Select To currency Type in
– Click inputs and
search

End

57
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

• Open the UiPath project folder


• Open the Useful link Word file, copy
Convert Currency.xlsx to the
project folder 2

58
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

• Data in Convert Current Excel file “Sheet1”:

Amount From To
2500 Australian Dollar (AUD) Chinese Yuan (CNY)
1400 Bulgarian Lev (BGN) Czech Koruna (CZK)
3200 Brazilian Real (BRL) Danish Krone (DKK)
4300 Canadian Dollar (CAD) Euro (EUR)
5000 Swiss Franc (CHF) British Pound Sterling (GBP)

59
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency
Search Read Range
1

Place it before Open


Browser and create
connector

60
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

3
1

2 4
“A1” means
reading from
worksheet cell 61
A1
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

• In the Read Range properties,


Click the DataTable field

• Right click and choose Create


Variable

• Create DTCurrency variable

62
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

• Illustration of Data Table DTCurrency rows and columns (Same


format as Excel sheet)

Amount From To
2500 Australian Dollar (AUD) Chinese Yuan (CNY)
1400 Bulgarian Lev (BGN) Czech Koruna (CZK)
3200 Brazilian Real (BRL) Danish Krone (DKK)
4300 Canadian Dollar (CAD) Euro (EUR)
5000 Swiss Franc (CHF) British Pound Sterling (GBP)

63
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

Search For each row

Insert it into Web,


BEFORE Do activity

64
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

Specify the
DTCurrency variable
that we have created
earlier

65
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

• Robot reads each row (For Each Row activity) stored


in DataTable DTCurrency

Amount From To
2500 Australian Dollar (AUD) Chinese Yuan (CNY)
1400 Bulgarian Lev (BGN) Czech Koruna (CZK)
3200 Brazilian Real (BRL) Danish Krone (DKK)
4300 Canadian Dollar (CAD) Euro (EUR)
5000 Swiss Franc (CHF) British Pound Sterling (GBP)
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

Move Do sequence
into the Body of For
Each Row in Data
Table

67
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

The Do sequence is
inside the Body of
For Each Row

68
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

How to access
the data in
each column?

69
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

Replace “100" with


CurrentRow(“Amount").ToString
70
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

CurrentRow("Amount").ToString

CurrentRow("From").ToString

CurrentRow("To").ToString 71
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency
• Go to Open Browser activity to create UiBrowser variable, AsiaOneBrowser.

1
Create variable AsiaOneBrowser

72
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

Search Close Tab

73
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 1 – Convert Currency

Set AisaOneBrowser variable

1
Click Properties Tab 74
OFFICIAL (CLOSED) \ NON-SENSITIVE

What Have You Learnt

• Read data from excel file into DataTable


• Read data from DataTable row by row
• Replace fixed data
• Use the following activities:
– Read Range
– For Each Row in Data Table
– Close Tab

75
OFFICIAL (CLOSED) \ NON-SENSITIVE

76
• After you search the currency
conversion result, you want to
Use Case 2:
save the data for future use.
Pull Data from Website
• You will modify UC 1 to extract
(This topic will take about 60 mins) currency conversion result and
save the result to Excel file.

77
OFFICIAL (CLOSED) \ NON-SENSITIVE

Approach

• Use Read Range to read data into a Start

data table Read data


from Excel
• Use For Each Row to implement the Write data to
looping for the data table rows Open browser
a
Excel

• Use Get Text to get result value from Close


website For Each row Browser

• Use Write Range to save data back to Search currency


conversion result
End
excel
Get result
and save
it to
datatable

78
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result

• Open Use Case 1

You can also open


recent project

79
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result

Go to project folder

Click project file “project.json” 80


OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result

• Let’s move the activities in Web into Open Browser

Double click

81
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result

• Let’s move the activities in Web into Open Browser


• You can also use “Ctr+c” to copy
2 Select “Copy”

Right click “Sequence”


82
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result


• Let’s move the activities in Web into Open Browser

Double click

83
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result


• Let’s move the activities in Web into
Open Browser
• You can also use “Ctr+v” to paste 2 Click Paste

UiPath activity

1
Right click mouse
84
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result

• Delete Web
• Reconnect Close Tab

Click “Delete” key on


keyboard to delete Web

85
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result

• Run the bot to check whether it still works

Why we
move
activities to
Open
Browser?

86
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result

• Add a Activity.
• Then click “Take Informative screenshot” from AsiaOne website to
get the result

Create a variable,
Result as the output

87
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result


• Add a to check the design
• Click F5 to run it
• You can disable Log Message after testing

Type Result here. It refers to the


1 data in column “Amount” and
then the data is converted to a
string.

88
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result

Click this box to get


conversion result

89
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result


• Now, we will output Result to Excel. We first add an
activity to assign result to Data table

This “Result” is This “Result” is


Column Name variable
in Excel

90
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result

• Add a activity between Open Browser and Close Tab

91
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result

A1 is the start cell

Check AddHeaders
option to add column
header into Excel
file. 92
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result

• Run the execution and verify your results in the Excel sheet.

How to
extract
the
values?
93
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result

Search activity "Matches", add it to Design


Panel

94
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result

Set properties of activity


"Matches"

Use pattern: "\d+\.\d+" to


extract real number with both 1
integer and decimal parts
2

Use Ctr+k to create variable


"RegMatches"
4
Save value to column "Final result"
CurrentRow("Final result")=RegMatches.First.ToString
95
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result

• What are Matches and Regular Expression?

All the matches

Regular expression can be used to search, extract and replace data based on
pattern

Reference on regular expression​: https://regexr.com 96


OFFICIAL (CLOSED) \ NON-SENSITIVE

Bit more on Reg Exp

• \d\d\d\d matches 4 digits


• \d{4} is the same

• Also possible to match specific characters


[ST]\d{7}[A-Z] to match an NRIC

In English: Find a text that starts with S or T, followed by 7 digits and


ending with an uppercase alphabet.

Reference on regular expression​: https://regexr.com 97


OFFICIAL (CLOSED) \ NON-SENSITIVE

Some more examples

Regular Expression In English Matches

\d{2} Find any string with 2 digits '12', '145', '34', '65', '7895'

[STGF]\d{7}[A-Z] Find NRIC / FIN 'S1234567A', 'F6734567A'

\s+\d{2}\s+ Find 2 digits enclosed by 1 or more '12', ' 12 ', ' 45 ', ' hi ', 'test'
spaces

www.\w+.com Find website url that matches 'www.test.com', 'www.rp.edu.sg',


www.something.com 'www.test.com.sg'

www.\w+.com.sg Find website url that matches 'www.test.com', 'www.rp.edu.sg',


www.something.com.sg 'www.test.com.sg'

Reference on regular expression​: https://regexr.com 98


OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result

1
What is the
difference between
the two Read Range
and Write Ranges
activities?

99
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result

• Excel->Read Range/Write Range works inside Excel Application


Scope and requires Excel being installed
• Workbook>Read Range/Write Range doesn’t require Excel
application
• More Excel activities than Workbook activities
• Workbook activities run faster than Excel activities in general

100
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result

• Let’s replace WorkbookRead Range by ExcelRead


Range

101
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result

• Delete Read Range, Add Excel Application Scope Activity

102
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result


• Add Excel Read Range activity
• Set variable DTCurrency

Link to Excel file “Convert


1
Current.xlsx”

Add “Read Range” Activity 3

Set variable “DTCurrentcy” 103


OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result

• Rename display name to increase readability

104
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result

• Right Click on Design Panel to add Annotation

105
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result

106
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 2 – Save Currency Conversion Result

• Run the UC 2 again and verify your result in the Excel sheet2.
• You will notice that Microsoft Excel Application is opened

107
OFFICIAL (CLOSED) \ NON-SENSITIVE

Further Reading

• Other Excel and Workbook activities

108
OFFICIAL (CLOSED) \ NON-SENSITIVE

What Have You Learnt

• Improve readability by using meaningful display


name
• Improve readability by adding annotation
• Extract data from a web page
• Update data into DataTable
• Write DataTable into Excel file
• Use the following activities:
– Log Message
– Assign
– Write Range
– Get Text
– Excel Application Scope
109
• You want to purchase a new smart
phone online but it will be tiring to
Use Case 3:
browse through pages and pages
Data Scraping of online data before you can
narrow down your search.
(This topic will take about 40 mins)
• You can design a bot to scrape
the online data for you and save it
to a data file so that you can do
further refinement on the search
data.

110
OFFICIAL (CLOSED) \ NON-SENSITIVE

Approach

• Use the Data Scraping wizard


• Save the data to a CSV file

111
OFFICIAL (CLOSED) \ NON-SENSITIVE

Hands-on Use Case 3 – Data Scraping

• Create a new project

• Open Lazada website


https://www.lazada.sg/

• Search “Smart phone”

Click Data
Scraping

112
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 3 – Data Scraping

Click next when the


browser is opened in
the background

113
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 3 – Data Scraping

Select the description of the first Lazada’s Choice.

Note: Please DON’T select the sponsored item as there are


only a few items

114
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 3 – Data Scraping

Select the description of the


second Lazada’s Choice.

Note: Please DON’T select the


sponsored item as there are
only a few items
115
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 3 – Data Scraping

Rename column
name to Description
1

2 3 Rename column
name to URL
check Extract URL

Click Next
116
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 3 – Data Scraping

Click Extract
Correlated
Data to get
price data

117
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 3 – Data Scraping

Must choose the


SAME TWO items for
product Description
and Price

118
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 3 – Data Scraping

1
Change to
Price

Click Next

119
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 3 – Data Scraping

Click Finish
1

120
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 3 – Data Scraping

• Scrap data from multiple pages

Click Yes

121
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 3 – Data Scraping

1
Click Next
122
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 3 – Data Scraping

Connect Data 1
scraping to the
start node.

Click Double
click to View

123
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 3 – Data Scraping
By default the Scope will be Data scraping.
Change the scope to Flowchart to enable the
variable to be accessed beyond Data Scraping.

1
Click here

Notice that the data


extracted from the Data
Scraping is being
2
Click here to open the outputted in a DataTable
variables window. named ExtractDataTable.
124
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 3 – Data Scraping

Search Write CSV

3
connect to Data
scraping sequence.
2

125
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 3 – Data Scraping

In the File Path, insert a file path for your CSV


file
• Specify the CSV file name with ending “.csv”
• Name your file “smartphones.csv” and it
will be saved in the folder where your
workflow is located.
1

2
Select ExtractDataTable.
126
OFFICIAL (CLOSED) \ NON-SENSITIVE

What Have You Learnt

• Perform data scraping using the Data Scraping wizard

• Write to CSV file


• Use the following activities:
– Write CSV

127
OFFICIAL (CLOSED) \ NON-SENSITIVE

128
Variables
(This topic will take about 5 mins)

129
OFFICIAL (CLOSED) \ NON-SENSITIVE

Variables

• Variables are containers that can hold a value


• Scalar Variables
– Boolean, Integer, Double, Date etc.
• Collections
– String, Array, List etc.
• Tables
– DataTable

130
String Manipulation
(This topic will take about 5 mins)

131
OFFICIAL (CLOSED) \ NON-SENSITIVE

String Manipulation
• Here are some commonly used string manipulation functions
1. Concat: connect two strings
MyString=String.Concat(" Good ", "morning! ")  “ Good morning! ”
2. Trim: Remove the spaces from both ends of a string
MyString.trim  “Good morning!”
3. ToLower: Convert string to lower case
Check the
MyString.ToLower  “good morning!”
sample script
4. ToUpper: Convert string to upper case provided in the
MyString.ToUpper  “GOOD MORNING!” Word file
5. Replace: Replace part of the string
MyString.Replace("MORNING", "afternoon")  “GOOD afternoon!”
6. substring: extract part of the string
MyString.Substring(0,4)  “GOOD” Number of characters
7. Split: Split a string based on the given string to be extracted
MyString=“Good morning! ”
MyString.split({“d"},stringsplitoptions.None) {"Goo", “ morning!"}

Start position: 0 is
the first character
132
OFFICIAL (CLOSED) \ NON-SENSITIVE

String Manipulation

• You can refer to the provided String Manipulation workflow


file to practise string manipulation

133
• You are thinking of what to
purchase for your son’s coming
Use Case 4:
birthday. You had previously
Data Manipulation (similar to Use Case 2) ran a bot
to scrape some price information
(This topic will take about 100 mins) from the internet.

• You now want to clean up the data


to have one single price value.

134
OFFICIAL (CLOSED) \ NON-SENSITIVE

Approach

• Read the price data Excel file TV


Items
S$ 220.00
Price

• Remove string “S$” iPhone S$ 272.58 to S$ 340.72


Wallet S$ 10.89
• Split string by “to” Shoes S$ 40.37

• Keep the first price value if there is Waterborrle Item not found
Gloves S$ 17.39 to S$ 17.55
more than one
• Remove space
• Convert string to number TV
Items Price
S$ 220.00
Price(S$)
220.00
• If price is not a number, set price as iPhone
S$ 272.58 to
S$ 340.72 272.58
0 Wallet
Shoes
S$ 10.89
S$ 40.37
10.89
40.37
Waterborrle Item not found 0
S$ 17.39 to S$
Gloves 17.55 17.39
135
OFFICIAL (CLOSED) \ NON-SENSITIVE

Outline of the Use Case 4

Start

Read Item list

Add one column

Convert data

Save data

End

136
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4
Create Flowchart
activity
1

137
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4

Excel: Read
Range
works inside Excel
Application Scope
and requires Excel
being installed
Workbook: Read
Range
doesn’t require
Excel application

138
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4

Select “Items List price.xlsx”

Choose worksheet and set


range. “” means all the data.
3

Create ItemsDT
variable
139
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4 – ItemsDT Visualization

• The data store in ItemsDT


Items Price
TV S$ 220.00
S$ 272.58 to S$
iPhone 340.72
Wallet S$ 10.89
Shoes S$ 40.37
Waterborrle Item not found
S$ 17.39 to S$
Gloves 17.55
140
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4

Add Add Data Column


activity to add one more
column to store price value

141
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4 – ItemsDT Visualization

• After Add Data Column, this is how the ItemsDT look like now.
Items Price
TV S$ 220.00
S$ 272.58 to S$
iPhone 340.72
Wallet S$ 10.89
Shoes S$ 40.37
Waterborrle Item not found
S$ 17.39 to S$
Gloves 17.55

142
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4

• Set Add Data Column activity properties

1 Create Column name "Price(S$)"

Set datatable to be ItemsDT

Set variable type to be Double


143
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4 – ItemsDT Visualization

• After setting the new data column, this is how ItemsDT look like
now. Items Price Price(S$)
TV S$ 220.00
S$ 272.58 to S$
iPhone 340.72
Wallet S$ 10.89
Shoes S$ 40.37
Waterborrle Item not found
S$ 17.39 to S$
Gloves 17.55

144
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4

• Create activity to process data

145
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4

Select ItemsDT

146
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4

• In Body of For Each Row activity

Right click to create the variable


PriceString
Get price from column "Price":
row("Price").ToString
1 2

3
Change the variable
type to String 147
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4

1 Replace "S$" by "" :


PriceString.Replace("S$","")

create variable ArrayString


Split string by "to":
2
3 PriceString.Split({"to"},stringsplitopti
ons.None)

4 Change
variable type to
Array of
String

148
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4

Assign the first string back to


PriceString

ArrayString(0).Trim
149
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4

• Exception handling
• Catches a specified exception type. The activity body
contains three fields:
– Try - The activity performed which has a chance of throwing an
error.
– Catches - The activity or set of activities to be performed when
an error occurs.
• Exception - The exception type to look for. Please note that you can
add multiple exceptions.
– Finally - The activity or set of activities to be performed after
the Try Catch block whether or not an error occurred.
150
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4

• Add a activity to handle exception


• Exception example: convert string “Item” to number will
generate error

151
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4

1 Convert string to double:


convert.ToDouble(PriceString)
create PriceValue variable

3
Browse for variable types to find and change to
system.double type, change scope to Body 152
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4

1
2
Select
System.Exception Set Price value to be 0 if there is an error

153
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4

Assign PriceValue to column “Price(S$)”

154
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4
• Add a activity to save data

Save data to worksheet “Sheet2”, start


from cell “A1”. Remember to check
Add Header property.
155
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4

• Set Write Range properties

156
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4 - Debug

• Enable Slow Step to observe step-by-step run

Trainer will do a
demo first. All
trainees must
practise it.
157
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4 - Debug

Click Breakpoints to
3 add a break point
2

Click Debug to run


the project

Click Assign: Price String 158


OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4 - Debug

• The project will stop at Assign: Get Price String

159
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4 - Debug

Click Step Into


1

Check PriceString value


from Locals panel
160
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 4 - Debug

• Discussion

• What is
Debug?
• When to use
Debug?

161
OFFICIAL (CLOSED) \ NON-SENSITIVE

What Have You Learnt

• Practise data manipulation

• Practise how to handle exception

• Practise debug
• Use the following activities:
– Add Data Column
– Try Catch

162
OFFICIAL (CLOSED) \ NON-SENSITIVE

2 Day goRPA Training Schedule

Day 1 Day 2
Morning Morning
Introduction of RPA and UiPath Handling and filtering data files

Reading excel and pull data from


website

Afternoon Afternoon

Scripting table data from the website Email Automation

Variables and Exception Handling UiPath Robot and Orchestrator

Debugging First use case discussion

163
OFFICIAL (CLOSED) \ NON-SENSITIVE

Quick Recap

• Introduction to RPA
– Productivity, Consistency/Accuracy, Scalability, Morale
• Use Case 1: Upload data to web from Excel
– Read Excel, DataTable, For each row, type into, click
• Use Case 2: Reading data from web
– As UC1, get Text, Selectors
• Use Case 3: Data scraping
– Reading large blocks of structured data, save to CSV
• Use Case 4: Variables and String Manipulation
– Integer, Boolean, Double,
– Replace, Split, Trim, Substring, toLower, toUpper

164
• Sally is working as a HR executive
in ABC Pte Ltd. She is in-charge
Use Case 5:
of consolidating over time (OT)
Handle Data Files and work information from each
Data department and computing the OT
pay for each staff in the company.
(This topic will take about 165 mins)
• Your task is to assist Sally to
develop a bot to sort OT files and
to compute a list of employees
who draw more then S$100 OT
pay.

165
OFFICIAL (CLOSED) \ NON-SENSITIVE

Hands-on Use Case 5 – Background Information

• There are 11 files in folder “Files”


– 2 Excel files with file names Over time XXX.XLSX
– 2 PDF files with file names Invoice_No_XXXXXX.pdf
– 7 other files

• This use case will


1. Classify all files and move them to folder “OT” or “Other files”
2. Read the over time Excel files in OT Folder
3. Calculate over time payment for each staff
4. Filter total overtime payment > S$100
5. Sort data based on total over time payment
6. Save the total over time payment data to an Excel file

166
OFFICIAL (CLOSED) \ NON-SENSITIVE

Approach

Start

– Read contents of folder


– Classify file based on filename
Classify Files
– Move file to respective folder

Process OT – Load all overtime Excel files


files
– Merge into 1 datatable
– Calculate overtime
End
– Filter and sort datatable
– Write datatable to Excel 167
OFFICIAL (CLOSED) \ NON-SENSITIVE

Approach

Start

Get file list


Reduce
Classify Files Counter by 1

Classified No Is OT Yes Move to


all files? file? folder “OT”
Process OT No
files Yes

Move to
folder
“Others”
End

168
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Open Project

• Open Handle Files –Day 2 Project

169
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – New Workflow Files

• Two Workflow files have been created


– GetFilesFromFolder.xaml
– ProcessOTFiles.xaml
• You can also create a new workflow file following the
screenshot below

170
Get Files from a Folder

171
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Get Files from Folder Process


Overview

• This process will retrieve the full path of all the files and the
number of files in the given folder

Name Direction Type Remark


In_FolderName In String Name of the folder
Out_ArrOfFiles Out String[] Array of file paths
Out_Count Out Int32 Number of files

Out_ArrOfFiles
In_FolderName
GetFilesFromFolder
Out_Count

172
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Get Files from Folder

• Open workflow file


– Click tab Project
– Double click GetFilesFromFolder.xaml

1
173
OFFICIAL (CLOSED) \ NON-SENSITIVE

Discuss what are


UC 5 – Get Files from Folder Direction In and
Out.

• Select the Flowchart


• Click Arguments

Arguments is to bring in
or return values.

Out_ArrOfFiles
In_FolderName
GetFilesFromFolder
Out_Count
174
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Get Files from Folder

Discussion

What is the
difference between
Variable and
Argument.

175
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 - Get Files from Folder

system.IO.Directory.GetFiles(In_FolderName)

1 Create two Assign


activities

Out_ArrOfFiles is the
2 list of all the files in that
folder.

Out_Count is the
number of files.
176
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Get Files from Folder

Discussion

How to test the


GetFilesFromFolder
process?

177
The Main Process Flow

178
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Main Process Outline

179
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Main Process Variables


• Go to the Main Process
• ArrOfFiles is to store the list of the files in a folder
• Count is the number of files in a folder

Discuss what is
the difference
between String
and String[].

180
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Create Invoke Workflow File Activity

• Add activity

2
Set DisplayName property to: Get files
from folder “Files”

181
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Create Invoke Workflow File Activity

Invoke Workflow File is to trigger a pre-defined workflow.

GetFilesFrom
Main Invokes
Folder
ArrOfFiles Count “Files” In_FolderName Out_Count Out_ArrOfFiles

Variables String Arguments

Import Arguments
connects these links

182
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Link Workflow File

• Link activity Invoke 1

Workflow File to the


corresponding workflow
file
2

183
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Link Workflow File


• Click Main to switch to Main file
• Click Import Arguments to configure the arguments

Input Output

Input data
Workflow file Returned data

This is folder
name
This is
variable
name

Left side is the list of Right slide is the list of


the arguments input variables or values 184
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Add Flow Decision Activity

Set DisplayName to:


Have classified all files? 2

185
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Set Decision Flow Properties

What is the
meaning of this
condition?

186
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Main Process Outline

Update variable Count in


4 activity Assign

Invoke
Workflow
1
5 Check whether it is an Over Time file

6 2

Execution ended
3 187
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Set Decision Flow Properties

ArrOfFiles(Count-1).ToUpper.Contains("OVER") and ArrOfFiles(Count-


1).ToUpper.Contains("XLSX")
We use (Count-1) here as array index starts from 0.
What is the
meaning of this
condition?

188
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Move File

189
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Create Invoke Workflow File Activity

Set DisplayName property to:


Process OT Files

Set WorkflowFileName to
190
“ProcessOTFiles.xaml”
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Midway Integration Test

• Run the Use Case from the Main Process


• Your files should be sorted into “OT” and “Other files”
folders

191
OFFICIAL (CLOSED) \ NON-SENSITIVE

192
Process OT Files

193
OFFICIAL (CLOSED) \ NON-SENSITIVE

Approach

Start Get OT files


Process the file

Create a new Add a new


Classify Files empty data column
table
For each
For Each row,
Process OT calculate,
Read each Total OT ($)
files
excel file

Merge the Filter and


data Sort data
End together
Write data
in Excel
194
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Get Files from Folder Process Overview

• This workflow will


1. Call GetFilesFromFolder to get the list of files in the OT folder
2. Load the data from all Excel files into a datatable
3. Merge datatables and calculate overtime payment for each staff
4. Sort and filter data based on total overtime payment
5. Save the total overtime payment data to a new Excel file

195
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Process OT Files

Double click
ProcessOTFiles.xaml

Click tab Project

196
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Process OT Files

• In workflow file ProcessOTFiles check out the following


variables: ArrOfFiles, Count, OTDatatable,
CombinedDatatable

197
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Invoke Workflow File Activity

• In the project tab, drag the GetFilesFromFolder.xaml


to the activity panel
• Rename “Invoke GetFilesFromFolder” to “Get files
from folder "OT" ”

198
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Process OT Files

• Configure the arguments

Input Workflow file Output

Input data Returned data

Left side is the list of Right side is the list of


the arguments variables or values
199
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Process OT Files

• Create a Build Data Table activity


DataTable: CombinedDatatable

2
Delete all the preset columns
and fields as shown

3 Click OK 200
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Process OT Files

• Create a activity
• Set values to be “ArrOfFiles”

ArrOfFiles is the returned value from


Invoke Get file from folder “OT”

201
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Process OT Files

• Set For Each activity properties

Change the Type Argument to String

202
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Process OT Files

• Create activity to read OT file

Output data to variable: OTDatatable 203


OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Process OT Files

• Create an activity to merge OT data

Merge OTDatatable to CombinedDatatable 204


OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Process OT Files

• Set the properties of Merge Data Table

Set Destination Set Source

205
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Process OT Files

• Create a activity
• Change display name to “Process OT data”
• Create activity

Add data column to


CombinedDataTable
206
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Process OT Files

• Set the properties of Add Data Column

New column name


"Total OT ($)"

Add column to datatable


CombinedDataTable

Column data type is Int32 207


OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Process OT Files
• Create activity
• Calculate the value for “Total OT ($)”
• Total OT ($) = Hourly OT rate X OT hours
CombineDatatable
DataTable

row("Total OT ($)")

What is Cint
here?
Cint(row("Hourly OT ($)"))*Cint(row("Overtime (hrs)")) 208
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Process OT Files

Outside of For Each


Row loop

Keep values in column "Total OT ($)" > 100


209
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Process OT Files

Sort column "Total OT ($)" in


descending order 210
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Process OT Files
• Output the result

Output result to "OT Summary.xlsx" Excel file


211
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 5 – Final Integration Test

• Run the Use Case from the Main Process


• An “OT Summary” excel file would be generated

212
OFFICIAL (CLOSED) \ NON-SENSITIVE

Project Organisation

A well-designed project should be:


- Reliable
 Solid, robust workflow that can handle error (Exception handling)
- Efficient
 Short development time and smooth execution (Remove
unnecessary steps)
- Maintainable
 Easy to update or make changes (Naming of workflows/ sequences
and variables to improve readability)
- Extensible
 Integrate new cases with existing workflow

213
OFFICIAL (CLOSED) \ NON-SENSITIVE

What Have You Learnt

• Practise how to access folder and files


• Practise file classification
• Practise merging, filtering and sorting data
• Project organization concepts
• Use the following activities:
– Message Box
– For Each
– Invoke Workflow File
– Flow Decision
– Move File
– Build Data Table
– Merge Data Table
– Filter Data Table
214
OFFICIAL (CLOSED) \ NON-SENSITIVE

Further Reading

• Datatable related activities

215
OFFICIAL (CLOSED) \ NON-SENSITIVE

216
• In the previous Use Case, you
helped Sally to develop a bot to
sort OT files and to compute OT
Use Case 6: pay for staff from various
Read Emails departments for her company.
• At the end of each month,
(This topic will take about 40 mins) department heads will send Sally
emails with the OT file attached.
Instead of manually downloading
the OT files, this process can be
automated as well.
• Your task is to assist Sally to
develop such a bot.

217
OFFICIAL (CLOSED) \ NON-SENSITIVE

Approach

• Use Get Outlook Mail Messages activity to Start


read emails
• Use For Each activity to process individual Download
emails emails

• Use Save Attachments activity to save the Save


email file attachments to a folder attachments
in each email

End

218
OFFICIAL (CLOSED) \ NON-SENSITIVE

Hands-on Use Case 6

• In this exercise, we will practise getting emails using


UiPath

• What you need:


– UiPath Mail activity package
– Outlook is configured in your laptop
– Some mails in your inbox

219
OFFICIAL (CLOSED) \ NON-SENSITIVE

Check Mail Package

• Click on the Manage Packages


button on the design tab

220
OFFICIAL (CLOSED) \ NON-SENSITIVE

Check Mail Package


• Under the All Packages tab, search for “mail” in the search box

221
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 6 – Read Emails

• Create a
• Create a
• Change sequence Display Name to “Get email via Outlook”

222
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 6 – Read Emails

• Search for and drag it into the


Sequence window

223
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 6 – Read Emails

• Set properties for activity Get Outlook Mail Messages

Use default account name if


it is empty

Set the folder to get emails

Create variable: IncomingMails


224
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 6 – Read Emails

Type in the variable that


Type in mail here.
you have created earlier
in Get mail messages
window, IncomingMails

1
2

Set the variable type as


System.Net.Mail.MailMessage

For Each is different from


For Each Row
225
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 6 – Read Emails

Drag Message
Box into the Body
of For Each
window Type
2
mail.Subject
1

226
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 6 – Read Emails

2
The mail
attachments will
be saved to
subfolder
227
"Attachments"
• Ella work as an admin executive
in a company offering work-based
Use Case 7: training for other companies. Her
Send Emails daily routine includes replying
enquiries for interest on courses
the company offer. Ella
(This topic will take about 40 mins)
consolidated email addresses of
the enquirers in an excel file.

• You task is to assist Ella to


develop a bot to automate the
sending of the emails.

228
OFFICIAL (CLOSED) \ NON-SENSITIVE

Approach

• Use Read Range activity to read in excel


Start
data
• Use Read Text File activity to read in email Get email list
body template from Excel

• Use string.format() to customize email body


Send email
• Use If activity to determine if attachment is based on
email list
needed
• Use the Send Outlook Mail Message End
activity to send emails

229
OFFICIAL (CLOSED) \ NON-SENSITIVE

Hands-on Use Case 7 – Send Emails

• In the current project


• Create a
• Change sequence Display Name to “Send email via Outlook”

230
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 7 – Send Emails

Start

Get email list


from Excel

Send email
based on
email list

End

231
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 7 – Send Emails
2

Copy these
files into
project folder

1
232
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 7 – Read Email List


• Drag activity as shown below
• Set properties as shown below

233
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 7 – Send Emails
Email list in Excel file “EmailList.xlsx”

Feel free to customize data

Set properties for Read Range activity

Create datatable variable EmailList


234
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 7 – Send Emails

• Email body text file:

• Text in {} are tokens and will be customized and replaced with


actual text

235
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 7 – Send Emails

• Add a activity below Read Range activity


• This activity reads in the email body text file

Click to select
"email_body_
plain_text.txt"
text file

236
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 7 – Send Emails

Create a new string


variable
emailbody_template
as output of the
activity
237
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 7 – Send Emails

Add activity

Rename the activity


For Each Row: Send Email
Input datatable variable EmailList 238
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 7 – Send Emails

• Add an activity in the body of For Each Row


• Add 2 activities

Set condition. Attach a file when column


“Attachment” is not empty
1

Fill in recipient and


subject of the email.
2

3 4 Set properties and attach


No attachment
a file 239
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 7 – Send Emails

• Add attachment
Set attachment file name from
EmailList column “Attachment”:
row("Attachment").ToString

2
Click Create
Argument

240
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 7 – Send Emails

• Replace {0}, {1} tokens with texts:


This replaces the {1}
found in
This is the Original email_body_plain_text
emailbody template file with sender name

This replaces the {0} found


in email_body_plain_text
file with recipient name 241
OFFICIAL (CLOSED) \ NON-SENSITIVE

What Have You Learnt

• Practise how to get Outlook Mail Messages and filter incoming emails
• Practise how to save attachments in Outlook Mail Messages to local
folder
• Practise how to send email with attachment
• Use string.format() to customize a string
• Use the following activities:
– Get Outlook Mail Message
– Save attachments
– Read Text File
– Send Outlook Mail Message
– If
– Append Line

242
OFFICIAL (CLOSED) \ NON-SENSITIVE

Robot and Orchestrator


(This topic will take about 30 mins)

243
• Jimmy has developed a few bots
which he will run them at least
once per week. After a few weeks,
Robot and Orchestrator Jimmy finds it is troublesome to
open UiPath Studio each time he
needs to run a bot. He wants to
(This topic will take about 30 mins)
explore a different way to run a
bot without opening UiPath Studio
and pass the robot to his
colleague without passing the
design code. Is that possible?

244
OFFICIAL (CLOSED) \ NON-SENSITIVE

Robot Execution

 Your scripts have been started from UiPath Studio


 You can run the script without UiPath Studio
 This is done using the UiPath Assistant

245
OFFICIAL (CLOSED) \ NON-SENSITIVE

Starting the Robot

• Search UiPath Assistant in your computer


• Run it
• You have to give the robot a name for the first time run

246
OFFICIAL (CLOSED) \ NON-SENSITIVE

Robot
• A process needs to be published before it can be executed on a
robot
• Run it to check whether it is working
• Click
1

Click Publish

You should see a


message like this
247
OFFICIAL (CLOSED) \ NON-SENSITIVE

Robot

• Run a process
– Automation project package is stored in folder:
C:\ProgramData\UiPath\Packages

248
OFFICIAL (CLOSED) \ NON-SENSITIVE

Robot

• Summary of steps to run a UiPath bot


– Step 1: Publish your project
– Step 2: Open UiPath Assistant
– Step 3: Click the bot to run it

249
OFFICIAL (CLOSED) \ NON-SENSITIVE

UiPath Assistant
• You can set a reminder date, time and frequency to get a reminder to
run the selected process

Click Add new reminder

250
OFFICIAL (CLOSED) \ NON-SENSITIVE

UiPath Assistant

Summary of steps to set reminder in


UiPath Assistant:
1. Open the UiPath Assistant
2. Click “Add new reminder” under the
Reminders tab
3. Choose the select process
4. Choose the Frequency
5. Choose the Time
6. Choose the Date
7. Save

251
OFFICIAL (CLOSED) \ NON-SENSITIVE

Distributing your script

• You can send the nupkg file to other UiPath users.


• They can copy the file into their C:\ProgramData\UiPath\Packages
folder and use the Robot to execute the package.

252
OFFICIAL (CLOSED) \ NON-SENSITIVE

Hands-on Use Case 8 – Environment Folder

Discussion

What happens with


External files that your
robot uses, when you
copy the script to
another laptop?

253
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 8 – Environment Folder

• Files that are in the project folder:


– Input files: they are included in the package, fixed until the package is
updated
– Output files: Will not be created
• Files in fixed folders (eg. C:\temp)
– Will still be read and created accordingly
– Issue when copied to other users, does this folder exists?
C:\Users\username\Documents\UiPath\files

254
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 8 – Environment Folder

• Environment folder are predefined folders on your computer, such


as Desktop, Documents, etc
• Everyone has a Desktop folder, but actual full folder differs based
on user account
• The get environment folder activity converts the predefined
folder to an actual folder. Allowing robots to read data from the
user’s document (sub)folder

255
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 8 – Environment Folder

• Create a new folder name EmailTemplate in your laptop’s


documents folder
• Move the three files into your document EmailTemplate folder
Create a new
EmailTemplate folder

256
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 8 – Environment Folder

Search get
environment folder

257
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 8 – Environment Folder

1 Right Click
FolderPath output
Select field to create a
MyDocuments string variable
DocumentFolder

258
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 8 – Environment Folder

Combine the My Documents filepath with EmailTemplate


folder name

259
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 8 – Environment Folder

Update the workbook


and text file path

260
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 8 – Environment Folder

Update the attachment


file path

261
OFFICIAL (CLOSED) \ NON-SENSITIVE

UC 8 – Environment Folder

• Run your bot, observe the files in EmailTemplate folder.


• Publish your bot, observe the files in EmailTemplate folder.

262
OFFICIAL (CLOSED) \ NON-SENSITIVE

Desktop to Enterprise automation

• So far, script has been running on your computer, using Studio or


robot
• Good for Desktop Automation
• What if you want to
– Deploy your bot to many machines
– Monitor the usage of bots
– Keep developing robots
• Enterprise level Automation

263
OFFICIAL (CLOSED) \ NON-SENSITIVE

UiPath Orchestrator

UiPath Orchestrator is web-based platform which


– enables fast deployment,
– can be used to audit and monitor robots
– schedules processes
– manages work queues
– includes release management
– supports centralized logging
– supports Role-based access

https://www.UiPath.com/orchestrator
264
OFFICIAL (CLOSED) \ NON-SENSITIVE

Deployment

Community Edition Enterprise RPA Platform


• Free for academia, non-profits and • Enterprise level
companies with less than $5M • Own UiPath Orchestrator
(USD) turnover • Support
• Orchestrator CE (2 robots) • Free trial
• Free

265
https://www.uipath.com/start-trial
OFFICIAL (CLOSED) \ NON-SENSITIVE

UiPath Orchestrator

Enterprise level

266
OFFICIAL (CLOSED) \ NON-SENSITIVE

What Have You Learnt

• Publish a package in Uipath Studio


• Run a Process in UiPath Robot
• Set a Reminder in UiPath Assistant
• Gain awareness of UiPath Orchestrator
• Use the following activities:
– Get Environment Folder

267
OFFICIAL (CLOSED) \ NON-SENSITIVE

Going Further

1. Tutorials www.UiPath.com/tutorials
2. UiPath Academy www.UiPath.com/rpa-academy
3. UiPath forum forum.UiPath.com
4. Youtube videos:
• UiPath Version: https://youtu.be/h3-L7qaTeEg
• UiRobot Offline Mode: https://youtu.be/eVD00t2Upjw
• UiRobot Online Mode: https://youtu.be/Uwmlaxvm83Q
• UiRobot Scheduling: https://youtu.be/TqnmN-01qAA

268
How to approach your first use case
(This topic will take about 45 mins)

269
OFFICIAL (CLOSED) \ NON-SENSITIVE

Your First Use Case

• What do you want to automate?


• How difficult is it?
• What is the impact?

• Is the process you want to implement a valid process?

270
OFFICIAL (CLOSED) \ NON-SENSITIVE

Example Use Case 1

We have a spreadsheet with leave


data for our employees and we want to
know who took how many days leave
in which month.

Is this a good first RPA use case?

271
OFFICIAL (CLOSED) \ NON-SENSITIVE

Example Use Case 1

No, Excel can do this

If Excel can solve it, why use


RPA?

Use Pivot Table to show data in


an organized way

272
OFFICIAL (CLOSED) \ NON-SENSITIVE

Example Use Case 2

We have a spreadsheet with leave


data for our employees and we want to
create a report per department, which
we will save as a separate Excel file
and email to the respective Heads of
Department.

Is this a good first RPA use case?

273
OFFICIAL (CLOSED) \ NON-SENSITIVE

Example Use Case 2

Yes Open Excel


Excel cannot send email
Use a template to send email For each department
Use a lookup excel sheet for
departments, HOD names and emails Filter data

Create Email

Send Email

274
OFFICIAL (CLOSED) \ NON-SENSITIVE

Example Use Case 3

I have two Excel sheets, one with


products and prices, one with a list
of products. I want to know how
much the list of products is in total.

Is this a good first RPA use case?

275
OFFICIAL (CLOSED) \ NON-SENSITIVE

Example Use Case 3

Why not use a VLOOKUP formula in Excel? VLOOKUP is


an Excel function to lookup and retrieve data from a
specific column in table.

No need for RPA


276
OFFICIAL (CLOSED) \ NON-SENSITIVE

Wastes and Improvement Ideas

• Value-add of process
– Do we really need it?
• Do we really need RPA?
– Can we implement the process in Excel / other software?
– For example Pivot tables or VLOOKUP

277
OFFICIAL (CLOSED) \ NON-SENSITIVE

Do We Really Need The Process?

• Often we do things because we have done them for a long time


– Is the process still relevant?
– Do we really need the data in the report?
• Is there a smarter way?
– Leverage on automation already present in existing software
– Allow the different systems to communicate with each other
• Encourage staff to recommend how their processes can be more
efficient

278
OFFICIAL (CLOSED) \ NON-SENSITIVE

Can The Process Be Simplified?

• Lean principles: Reduce waste


– Reduce defects
– Reduce motion
– Reduce extra processing

279
OFFICIAL (CLOSED) \ NON-SENSITIVE

Reduce Defects

• Validate inputs
– Garbage in, garbage out
• Standardize inputs using forms
– Structured data is easier to read
• Standardize between processes
– Address format, data / time format
– Templates
• Make documents easily readable for computers
– Reduce merging cells, adding data between rows

280
OFFICIAL (CLOSED) \ NON-SENSITIVE

Reduce Defects

Before LEAN After LEAN – use Excel rather than RPA

delivery note (DN) airway bill


airway bill delivery note (DN)
DN1234 DN1234 1234
1234 DN0987
Delivery Note (DN) Airway bill DN8456 Delivery Note (DN) Airway bill
DN0987 DN3456 DN0987
DN0987 1234
DN5678 5678 DN4567 DN5678
DN1234 DN5678 DN1234
DN9876 DN8456 1234
1234 DN5643
DN6539
DN3456 5678
Required DN4567 5678
Airway bill # Ctrl+F (Find) DN5678 5678
DN9876 1234
required by each airway bill DN5643 1234
customer for from delivery DN6539 1234

critical parts note maintained


by order
scheduler

281
OFFICIAL (CLOSED) \ NON-SENSITIVE

Reduce Motion

• Minimize open files or web pages


– Open once, read once, store in variables
• Minimize mouse clicks
– Use keyboard shortcuts, e.g. <alt> in Office

282
OFFICIAL (CLOSED) \ NON-SENSITIVE

Reduce Motion Using UiPath

• Reduce the number of mouse click


– Use short cut keys
• Standardize process to reduce process
variability

UiPath Tutorials
https://www.UiPath.com/kb-articles/how-to-automate-sap-applications-the-quick-guide 283
OFFICIAL (CLOSED) \ NON-SENSITIVE

Reduce Motion in SAP

• “KA01” is short cut key


for Create Cost Element

284
OFFICIAL (CLOSED) \ NON-SENSITIVE

Reduce Extra Processing

• Don't Double Confirm


• Focus on what is needed
– Don't do because it is technically possible
– Keep it simple short

285
Complexity VS Impact

286
OFFICIAL (CLOSED) \ NON-SENSITIVE

Complexity VS Impact

• How to decide which process to automate first?


– Time saved
– Proneness to errors
– Impact on work force
VS
– Complexity of process
– Policies (data privacy / impact)
– Politics (departments, people involved)

287
OFFICIAL (CLOSED) \ NON-SENSITIVE

Prioritise Process: Complexity VS Benefits

Choose less complex use case


• When we do the detailed process mapping later, it is likely that the process is generally
more complex than we think, when we do it step-by-step
• Re-usable automation for future use cases
• Better to have a reliable first use-case you can continuously improve and try to create a
complex, large scale automation that we cannot scale.
288
OFFICIAL (CLOSED) \ NON-SENSITIVE

Draw Process Flowchart


Create the simplest manual repetitive process you
have, that will not change for next 6 months
Start

Open Items List Excel

Open Edge and go into “www.lazada.com.sg”

Type in Items to search in Lazada

Yes
Paste first price displayed
on Lazada back to Excel
More Items
to search in
Lazada?

Note: Draw it on paper first, its No

much faster and easier to iterate. End

289
OFFICIAL (CLOSED) \ NON-SENSITIVE

Process Complexity Assessment


Lazada Use Case Example
Assumption now:
• Manual and repetitive tasks
• Stable process not expected to change within six months

290
OFFICIAL (CLOSED) \ NON-SENSITIVE

Process Complexity Assessment

291
OFFICIAL (CLOSED) \ NON-SENSITIVE

Automation Benefits
Lazada Use Case Example

Name of Process Ebay price checking process Remarks


Including
time
taken for
Time per process per staff (hr) 1 errors
Frequency of process per month per
staff 4
No.of staff 1
Total man-hours per month 4 292
OFFICIAL (CLOSED) \ NON-SENSITIVE

Automation Benefits

293
OFFICIAL (CLOSED) \ NON-SENSITIVE

Process to Implement Use Case

1. Talk to all stakeholders


– Find out why the process is how it is
2. Draw a process flowchart
– Validate flowchart with stakeholders
3. Assess the complexity and benefits
– Use the tools given
4. Draw detailed flow diagram
– Use screenshots or explorer expert, step-by-step
instructions
5. Map process to UiPath activities
– Match instruction to specific activities
6. Implement in UiPath Studio
– Implement bit by bit and test continuously
294
OFFICIAL (CLOSED) \ NON-SENSITIVE

Draw Detailed Flow Diagram


Detailed Process Mapping UIPath Activities, Flow, Pro
Step Input Description Details (Screen/ Document/ Output Exception Han
Video recording Index) Activity Details and Flo
Activity Property R
1 Open Edge and Enter Output: Settings
enter website Enter Lazada Flowchart
"https://www.laza address webpage
da.sg/" Open
Browser
M
Read Excel th
Read
2 Read excel file File to obtain search item fi
Range
search item under
pr
workbook
s
lo
Choose the first Copy the first For Each
3 item from the data from Row
excel file excel.
Assign 295
OFFICIAL (CLOSED) \ NON-SENSITIVE

Draw Detailed Flow Diagram to UiPath Activities


Detailed Process Mapping UIPath Activities, Flow, Property Settings and
Description Details (Screen/ Document/ Output Exception Handling
Video recording Index) Activity Details and Flow Exception
Activity Property Remarks Handling
Settings
Enter Output: Flowchart
Webpage
website Enter Lazada
is not able
address webpage Open
to load
Browser
Must save
the excel
Read
Read Excel file into
Range cannot
File to obtain search item the
under read Excel
search item project or
workbook
specific
location

For Each
Copy the first
Row
data from
excel.
Assign
296
OFFICIAL (CLOSED) \ NON-SENSITIVE

Draw Detailed Flow Diagram


Detailed Process Mapping UIPath Activities, Flow, Prop
Exception Han
Step Input Description Details (Screen/ Document/ Output Activity Details and Flow
Video recording Index) Activity Property Re
Settings
Toggle to lazada Re
website and paste the Copy first item to
4 data over. Enter the from excel to Type into fie
search button to get website us
the information
Cha
Output: pri
Select the price and Copy out the Get Text
wil
5 Price for Tissue Paper
copy it price shown allow
based on website Try Catch
of p
ca
Select the correct cell
Output:
and worksheet in the Insert the price
6 Reflect price for Tissue Assign
Excel and paste the into excel
Paper in excel
information over

Repeat the same


Output:
process to get
7 Repeat step 3 to 6 Reflect price for all items
the price for all
in excel
the 6 items
297
OFFICIAL (CLOSED) \ NON-SENSITIVE

Draw Detailed Flow Diagram to UiPath Activities


Detailed Process Mapping UIPath Activities, Flow, Property Settings and
Exception Handling
Description Details (Screen/ Document/ Output Activity Details and Flow Exception
Video recording Index) Activity Property Remarks Handling
Settings
Remember
e Copy first item Nothing is
to empty
being paste
from excel to Type into field when
onto the
t website use "Type
search box
into"

Change the Webpage is


Output: price using not able to
Copy out the Get Text
wildcard to load
Price for Tissue Paper
price shown allow a range
based on website Try Catch
of price to be No search
captured item found
ll Excel is not
Output:
e Insert the price able to paste
Reflect price for Tissue Assign
into excel data into the
Paper in excel
cell

Repeat the same Excel is not


Output:
process to get able to paste
Reflect price for all items
the price for all data into the
in excel
the 6 items cell

298
OFFICIAL (CLOSED) \ NON-SENSITIVE

Map Process to UiPath Activities

UIPath Activities, Flow, Settings and • Focus on completing your first bot
Exception Handling first, then use more efficient
activities and improve its reliability
Activity to Use

Possible Actions/ Bot Exception


design Alternatives Handling
Remarks for
UiPath
UiPath

Flowchart Create more wait


Webpage is not
time for the system
Open Browser
able to load
to load the page

299
UiPath Task Capture

300
OFFICIAL (CLOSED) \ NON-SENSITIVE

Setup UiPath Task Capture

• Download UiPath Task Capture from


https://www.uipath.com/product/task-capture/download-task-
capture

• Setup Task Capture

301
OFFICIAL (CLOSED) \ NON-SENSITIVE

Capturing Process using Task Capture

• Double Click

• Double Click “Capture Process”

• A recording screen will appear and


start recording automatically.

302
OFFICIAL (CLOSED) \ NON-SENSITIVE

Capturing Process using Task Capture

• Continue your work process, Task


Capture will capture what you are
doing.

• After you have completed your work.


Click the stop button to stop
recording.

• Task Capture will generate a flowchart


diagram

303
OFFICIAL (CLOSED) \ NON-SENSITIVE

Capturing Process using Task Capture

• Click on Export & Publish


1

• Select Word Document


2

304
OFFICIAL (CLOSED) \ NON-SENSITIVE

Capturing Process using Task Capture

• Give a title, Description or


author

• Click Next
1

• Click Export

• A word document of process


definition document will be
generated
2

305
OFFICIAL (CLOSED) \ NON-SENSITIVE

Capturing Process using Task Capture

• The document will document


the high level and detailed
statistics as well as detailed
process steps.

306
OFFICIAL (CLOSED) \ NON-SENSITIVE

2 Day goRPA Training Schedule

Day 1 Day 2
08:30
09:00 Welcome and introduction to RPA
Introduction to UiPath Use Case 5 - Handle Data Files and data
09:30 Use Case 1 – Convert Currency, Flow Decision, Get files, Use Invoke Workflow File, Merge
10:00 Open Browser, Web Recording, Basic Selectors datatable, Filter data table
10:30 Tea Break Tea Break
11:00
Read Excel, For Each Row, Close Tab Sort datatable , Project organisation
11:30
12:00
Lunch Lunch
12:30
13:00 Use Case 6 and Use Case 7- Email Automation
Use Case 2 - Pull Data from Web Site
13:30 Log Message, Selectors
14:00
UiPath Robot and Orchestrator
14:30 Use Case 3 - UiPath Data Handling - Data scraping
15:00 Tea Break Tea Break
15:30
How to Approach Your First Use Case
16:00 User Case 4 – Data Manipulation
String manipulation, Variables, Conditional statement,
16:30 Exception handling, Add data column, Practise Debug First Use Case Discussion
17:00

307
First Use Case Discussion

308

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy