CCL1188-K23 1694705256955001ivr9
CCL1188-K23 1694705256955001ivr9
ServiceNow
Scenario
In this lab we use a custom application on ServiceNow to track vistors to our campus. Based
on visitor registrations we need to create Badges using a home grown windows application and
enter the visitor data into a web form. The application part on ServiceNow is prepared for us,
but the robot part is yet to be made. You will now start as the RPA developer.
Additional Ressources
Known Limitations of UI Recorder:
KB1225708
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1225708
Product Documentation
Universal App Connector
https://docs.servicenow.com/bundle/utah-integrate-applications/page/product/rpa-
studio/concept/universal-app-connector.html
Recodring Automations
https://docs.servicenow.com/bundle/utah-integrate-applications/page/product/rpa-
studio/concept/recording-automations.html
Upgrade procedure for San Diego and Tokyo to Utah
KB1124296
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1124296
Note: All these plugins are part of paid subscription packages. If they are not
visible in your instance the most likely reason is that they are not part of the
current subscription packages. The required packages are App Engine and
Automation Engine.
Note: As you start the App Engine Studio the first time, a Getting Started
dialog is displayed. You can safely close it.
2. Open Visitor Management Application in App Engine Studio
Visitor Application in AES
3. Have a look at the App, it consists of one table to hold visitors, a few experience records
and a flow. We will inspect them later in more detail.
4. Navigate to Experiences and open workspace (click on preview) Visitor Management
Assign Configuration
3. Select the preconfigured Vistor Bot Config and click Submit
Add PC Menu
2. Copy the IP address from the registration page and enter it under PC Name (1) and enter
Lab VM under Friendly Name (2). Then click Add (3).
IP Address in Lab Environment Screen
Note: The IP Address is only the value within the [] brackets on the Windows
Server line.
3. Double click on the new VM that was added to RDP.
Lab VM Link
Then click Continue.
4. Enter the Windows Server login credentials provided during registration underUsername
(1) and Password (2) and then click Continue (3).
Note: The IP Address is only the value within the [] brackets on the Windows
Server line.
2. Click More choices.
4. Type Administrator for Username (1) and the lab password for Password (2). Then
click OK (3).
Note: If at any point throughout the lab a pop up appears saying that updates
are available, this window can be closed by clicking “View Details” and then
clicking the X icon.
2. Before getting started, it is recommended to change the default browser to Chrome. This
can be done by typing Default Browser in the Windows Search Bar and clicking Choose
a default web browser.
Choose Default Browser
3. Click Internet Explorer under Web browser and select Google Chrome. Then X out of
the window.
Chrome Browser
4. Using Chrome on the virtual machine, login to the lab instance provided
Tip: You can copy and paste values from your machine into the VM using the
regular key bindings of Ctrl-C / Ctrl-V.
1. To populate this form the correct hostname is required. Fastest way to get this is
using a windows command prompt. Open the context menu on the Start menu and
select Windows PowerShell
Start PowerShell
Hostname
The hostname will start with IP- and end with a unique character/number
combination.
Field Value
Name Lab VM
Click Save
Create Robot
This step is required to give the robot we build in exercise 2 access to the relevant data
and queue entries in RPA Hub.
13. Enter KB0010001 in the global search field and press Enter
Global Search
14. A knowledge article will be displayed containing the one file required for this lab.
Download the BadgeTool.exe file to your local machine. This is a required program for
later.
15. Move the downladed file to the Desktop for quicker access
17. Select the Unblock checkbox to allow execution of this program and close the dialog.
Unblock Badge Tool
Badge Tool
20. Populate the dialog with these values and click Connect
Field Value
URL to your
RPA Hub instance
Authentication Basic
Username rpa.robot
Password 9?{4$Pf6Jc8x]W
Note: The mentioned user has been created for you in the lab instance. On
your own instance you will need to create a bespoke user and assign the
sn_rpa_fdn.rpa_robot role.
21. The Unattended Robot will confirm its connection and present the robot name we
created.
You can close the window, the unattended robot will continue to run. An icon in the
system tray next to the clock will be showing. It will also show a yellow warning sign as
we use basic authentication for this exercise. In a productive setup we do recommend to
use certificate based authentication (mTLS).
Further references:
https://docs.servicenow.com/bundle/utah-integrate-applications/page/product/rpa-
core/task/install-user-certificate-rpa.html
2. On the first launch of RPA Desktop Design Studio, a connection will need to be made to
the ServiceNow instance. In the Connection Manager window, enter Lab Instance under
Name and enter the instance URL under URL. Then click Launch in default browser
and click Proceed.
Connection Manager
Note: This will take some time, but only needs to be completed the first time
RPA Desktop Design Studio is opened.
4. Wait for RPA Desktop Design Studio to open and then click Unattended Automation.
New Unattended Automation
Field Value
Name Visitor Robot
Enter visitor data to BadgeTool and RPA
Description Challenge
Note: The default location to store automations is on your desktop. You can
change this to any other location if you prefer.
6. Expand Activities in the Project Explorer, do a right-click on it and select New Acticity
New Activity Menu
7. Double click the New Activity and change its name in the Properties window toGet Data
from RPA Hub
Activity Properties
Note: This will also open a new tab on the main canvas with the new activity.
It will change its tab title as you change the name.
Drag Queue
10. Expand the Global Objects and double click the Queue entry
11. In the properties window enter theQueue Name as Visitor Queue
Queue Name
Note: Make sure you change the Queue Name and not the Name property.
12. If not yet selected, double click on the Queue entry in Project Explorer, find
PickWorkItem in the Toolbox window. Drag it to the canvas.
Configure Queue
16. Add the following path notations by clicking+ 9 times and entering these values. Click OK
once completed.
Note: You can change the sequence if you want, but make sure you enter the
values as mentioned. The robot is case sensitive and will produce an error for
any spelling mistakes.
JSON PATH
NOTATIONS
Company
Email
Access Level
First Name
Title
Phone Nr
ID
Last Name
Location
Create a Variable
This component will pick an item from the Work Queue and extract the content in
Request Content field as individual properties. You may test the component by using the
Assign bot process action in the ribbon and then use Run from here in the context
menu. For this lab we do not use any filter criteria on this component, you can execute is
as often as you wish and it will pick the same work item over and over again.
17. Create new global variables to store the content retrieved from PickWorkItem by right-
click on Global Objects in the Project Explorer and select Create a Variable, repeat this
10 times to create all variables needed.
Add Variable
Note: This lab uses global variables so it is easy to use them anywhere in the
automation project. You can also use local variables but need to provide all
the mappings then from one activity to the next.
18. Double click on the variables and rename the variables to match the JSON Path notations
above; name the extra variable WorkItemId.
Variables
Connect Variables
22. To ensure the automation runs only when there is an item in RPA HUB, drag
IsNullOrEmpty component from Toolbox and drop it on the control out port of
VARIABLES
isNullOrEmpty
Decision
25. Type IsEmpty in the yellow expression field and pressEnter, this will create a new data
input port for the variable isEmpty
26. Connect the return value from IsNullOrEmpty to the IsEmpty input of the DECISION
component
27. Drag General > Terminate component to canvas and connect it with the True Control
port of the DECISION
Terminate Component
Port Properties
Note: It is a good idea to press the Save icon every now and then on the header bar
of RPA Desktop Design Studio. It will autosave also, but saving can never be often
enough, right?
Launch Recorder
2. Launch BadgeTool from your Desktop
3. On the right side of your VM windows you will find the toolbar for the recorder. Click on
the red Start recording button.
Start Recorder
4. Hover on the Generate Employee Badge button and select the Click action in the
floating controls
Note: The type of object currently highlighted is written in the yellow box
above, <button> in this example
Tip: Press Ctrl to stop the floating controls from moving or updating to other
items.
Once the click is recorded, it will also be executed and BadgeTool will move to the next
screen where data for the badge to be generated can be entered.
5. Hover on the text field for Name, notice the yellow field on the recorder overlay states
pane, click the Up Arrow next to it until you see it showing Edit, click the SetText button.
6. Enter Name into the value field for pane and click Record
Enter value for Name field
Tip: It is a good idea to enter the name of the field into this box in order to
identify the element later on in RPA Desktop Design Studio.
Note: You might get an error stating thet the recorder was ‘Unable to invoke
action but action was recorded into the list’. You can accept this error as it is
still recorded just fine.
|Field
ID Number
Title
Location
8. Hover on the drop down list for Access Level, click SelectItem, on the dialog enter
Access Level as value and click Record
Save Recording
12. Enter details as follows and click Save recording on the bottom of your screen
Attribute Value
Attribute Value
Note: RPA Desktop Design Studio will reappear with a new activity open with
the recorded steps.
13. Inspect the recorded activity and notice all SetText components are named edit, the only
difference is the text value which is set. The following steps will rename the elements to
make the automation easier to read.
14. Right click on the new global object Badge Tool and select Configure
1. Select one of the edit elements in the Screens and elements part of the window
2. In the Match Attributes part find the ID attribute, this tells us which edit element is
selected. In the Properties section find the Name attribute and change it to match
the ID value.
Select Edit Element
5. Click Done, notice that all components on the canvas have updated to the new
names
15. Now it is time to replace the recorded values with the dynmic input from the previous
activity. As the Badge Tool does not differentiate between First and Last Name we need
to format our variables accordingly. Drag a General > Format Text component from the
Toolbox to the canvas
17. Drag First Name from the Project Explorer’s Global Objects to the first yellow dot infront
of the {0}, Drag Last Name to the second yellow dot
Note: The display will change to show the variable names in square brackets
18. Click the configure Gear icon for the FORMAT TEXT component
19. Enter {0} {1} into the text field dialog of the Format Text Editor and clickOK
Challenge: Add also the Title as a 3rd input to the Format Text and expand the format to
use it.
20. Place the FORMAT TEXT component right before the txtName-SetText component and
connect it.
21. Double click into the “Name” property on the txtName-SetText component, empty it.
Once you leave the field a connection port will appear.
22. Connect the data port from FORMAT TEXT with the new data port on SetText
23. Double click into the “ID Number” property on the txtNumber-SetText component,
empty it. Once you leave the field a connection port will appear.
24. Drag the ID variable from Project Explorer onto the yellow data port
25. Repeat these steps for all other variables and map accordingly.
26. The only missing steps are now to open and close BadgeTool. Double clickBadge Tool
object in the Project Explorer. Drag the Start component from Object Explorer onto the
line between START and BadgeTool-WaitForCreate.
Note: Make sure the line is highlighted with a light shadow as you drop the
component. This will automatically connect it as needed.
27. Double click the AppType attribute and select Application from the Static Value drop
down list.
28. Double click the Path attribute and enter the path to BadgeTool.exe
Note: The path can be easily copied from the Properties > Security tab on
the BadgeTool icon.
29. Double click the Badge Tool screen in Project Explorer (second level element) and drag
Close from Object Explorer just before the END of the automation
Close BadgeTool component
Note: You may want to try this part of the automation. In order to test, you will need
to first run the Get data from RPA Hub activity to populate the global variables.
Once this executed, you can run the Enter Data to BadgeTool and it will work.
Also, if BadgeTool is still running, close it or the robot will open a second instance.
Launch Recorder
2. Open the Chrome browser
Launch Chrome
3. If this is the first time Chrome is launched, it will ask wether or not to enable the
ServiceNow RPA Chrome Extension. Enable it as it is required for the robot to interact
with the website.
6. To capture the first element hover over the input field on the top left (1) until there is a red
rectangle around it. Press control so the green SetText button does not move anymore.
Click the SetText action (2), add a text (3) and the press record (4). This will record the
input of a text into that field.
Note: This website will move the fields to different places on every reload. So
your order will be different than on these screenshots. This is ok and
expected, just start from the top and make sure you capture all fields with the
names as they are on your screen.
Tip: As with the previous exercise it is a good practice to use the field names
as value when recording. This will help identifying the elements in RPA
Desktop Design Studio.
|Field
Last Name
|Field
Email
Address
Company
Role in
Company
Phone Number
This will also reload the page and rearrange the fields again.
9. All needed steps are recorded, Stop the recording
Attribute Value
Enter Data To
Activity Name
Form
Save global object as New global object
Global object name RPA Challenge
Save Recording
Note: RPA Desktop Design Studio will reappear with a new activity open with
the recorded steps.
11. Inspect the recorded activity and notice all SetText components are just numbered
elements, the only difference is again the text value which is set. The following steps will
rename the elements to make the automation easier to read.
12. Right click on the new global object RPA Challenge and select Configure, just like in the
previous part.
1. Select one of the numbered elements in the Screens and elements part of the
window
Note: The first recorded element does not even have a number, start
with that one.
2. In the Match Attributes part find the ng-reflect-name attribute, this tells us which
edit element is selected. In the Properties section find the Name attribute and
change it to match the ID value.
3. The website has added an extra challenge as it moves the fields to different
locations everytime it is loaded. To compensate for this the locator has to be
changed from CssSelector to TagName.
Tip: Locator: The locator is how our connector finds the element on the
webpage. There are different options to choose from. The most reliable
one would be ID, as an ID on a website is unique and hence the
connector will always find the correct element. The RPA Challenge
website does not use ID’s to make it somewhat more challenging. A
CssSelector would try to find elements following the HTML Document
Object Model (DOM), this will also not work as the path would change
with every load. TagName is the most generic and basically scans the
whole page of any tags with the given TagName.
4. There is obviously more than one tag on the page with a TagName ofINPUT, to tell
the connector which element is the correct one enable the checkbox next to
Attribute ng-reflect-name Equals …. in the Match Attributes area. This will be
used as additional criteria when looking for the element on the page.
6. Select the submit7 element, change the Locator toTagName as well and enable
the Attribute type Equals submit in the match attributes
7. Click Done, notice that all components on the canvas have updated to the new
names
13. Replace all the hard coded texts in the components with the global variables, just like in
the previous exercise
Hint: Delete the hard coded texts to get a input port, drop the variable on this
input port to use data teleportation.
Field / Component Variable
labelCompanyName Company
Access
labelRole
Level
labelAddress Location
labelPhone Phone Nr
labelLastName Last Name
labelfirstName First Name
14. Double click RPA Challenge object in the Project Explorer. Drag the Start component
from Object Explorer onto the line between START and RPA Challenge-WaitForCreate.
Note: Make sure the line is highlighted with a light shadow as you drop the
component. This will automatically connect it as needed.
15. Double click the AppType attribute and select Chrome from the Static Value drop down
list.
17. Double click the RPA Challenge screen in Project Explorer (second level element) and
drag Close from Object Explorer just before the END of the automation
Note: You may want to try this part of the automation. In order to test, you will need
to first run the Get data from RPA Hub activity to populate the global variables.
Once this executed, you can run the Enter Data to BadgeTool and it will work.
Also close down Chrome before you start, otherwise the robot will open yet another
tab in the existing session.
Hint: You can either click the already open tab or double click on the Main
activity in Project Explorer
2. Drag all other activities to the canvas one by one
Main Activity
Note: If you have skipped Part III of this lab you will miss theEnter Data to
Form activity. That is ok and the automation will still work.
6. Drag the global variable WorkItemId on the data port for WorkItemId
8. Double click the InProgess attribute and change the static value toSuccess
Note: This is the place where you would be able to return information to the
instance. In this case we simply mark the item as Success. In real world a
differentiation of different states combined with error messages will make your
automations really powerful.
9. Use the Clear log function in the ribbon to reset anything from previous runs, then click
Run to execute your automation end to end. RPA Desktop Design Studio will hide and
you will see how the robot is executing all steps as defined.
Test Run
Note: If your exeuction stops with an error debug the error and fix it before
continuing.
10. Make the automation available within RPA Hub by publishing the package. ClickPublish
in the ribbon
RPA Hub
Field Value
Publish as New Version (to existing package)
Package Name Visitor robot (prepopulated)
Provide a commit comment like ‘Excercise 3
Comments completed’
Publish Project
Note: On the lab instance we prepared a package for you as well, hence this
step is using New Version to existing package. Usually you will start with a
New Package on your first publicaiton.
Tip: These steps can be done on the virtual machine or on your local laptop
2. Open your bot process by navigating to Lists > Build > Bot Process, open Visitor Bot
Config from the list
3. On the Details tab fill out the Package and Package Version fields
Bot Process with Package configuration
4. Click Save
Credential Sets
6. Click New
Field Value
Name Windows VM Credentials
Windows User name ip-XXXXXX\administrator
the adminstrator password assigned to
Windows Password
you
Note: Replace the XXXXXX with the unique number of your hostname as
entered in exercise 1 when creating the robot entry. Go back to exercise 1 if
you need to find it again.
Credential Set VM
8. Click Save
12. Select the created Credential Set Windows VM Credentials as well as the Lab VM robot,
click Save
Process Robot Credential
13. Navigate to the Visitor Management workspace you have been earlier
14. Send at least one more record to the robot as before to create more work for our robot.
Every time you use the UI Action, a new record in the work queue will be created.
15. Make sure you are still connected to your virtual machine and you can quickly switch to it,
it should not be in lock screen.
16. Navigate back to RPA Hub and open your Bot Process
17. Click on Start Process to trigger the robot, select your Lab VM robot and click Start
Process in the dialog window
18. Bring your virtual machine to front and watch the robot doing its work.
Note: the first time it is executed, the robot will take more time as it needs to
synchronize its runtime from the instance. Every following process will be
much quicker.