Trigger Based Attended Automation In UiPath

I am using UiPath Studio 2019 community version. Today we will explore a ready-to use-template called "Triggered Based Automation", as the template name suggests, it triggers as an automation in response to a mouse or keyboard user event.
 
Trigger Based Attended Automation in UiPath
 
Select trigger based attended automation and create it by assigning a name.
 
Trigger Based Attended Automation in UiPath
 
After creation, it will look like below,
 
Trigger Based Attended Automation in UiPath
 
As you can see we have 3 trigger activities,
  1. Click
  2. Key Press
  3. HotKey
And then we have “Event Handler”. It will be executed once one of the 3 activities gets triggered.
 

Click Trigger

 
This activity monitors click events. After a click on the selected area on the screen, this activity gets triggered. We can use this activity inside the “Monitor Events” activity.
 
Here are the properties for this activity,
 
Trigger Based Attended Automation in UiPath
 
When we select a particular UI element on screen using “Indicate element on screen” option on-click trigger, then in the “selector” property we will get an XML representation as string.
 
Ex. If I click on “File” menu of Microsoft Word document then it’s selector will be like,
 
 "<wnd app='winword.exe' cls='OpusApp' title='New Microsoft Word Document - Microsoft Word (Product Activation*' />
<uia cls='MsoCommandBar' name='Ribbon' />
<uia automationid='FileTabButton' cls='NetUIRibbonTab' name='File Tab' />"
 
Trigger Based Attended Automation in UiPath
 

Key Press trigger

 
This activity gets triggered when a particular keyboard key is pressed on a specified UI element. Like the Click trigger, we can use this activity inside “Monitor Events” activity only.
 
Trigger Based Attended Automation in UiPath
 
As in the click trigger activity, selector is the same way; we have to select selector for this activity.
 
We will take a previous example of MS Word. Suppose now you want to open a new word document after clicking on blank space and using shortcut key “Alt+N”. Then your activity will be like this,
 
Trigger Based Attended Automation in UiPath
 

HotKey Trigger

 
This activity monitors a specified system-wide key event. Whenever these key combos are pressed onscreen then it gets triggered.
 
Trigger Based Attended Automation in UiPath
 
To check if it is working or not I have taken a message box like below in event handler
 
Trigger Based Attended Automation in UiPath
 
After executing and performing a particular click or key press we will see the below message box
 
Trigger Based Attended Automation in UiPath
 
Note
In this built-in template they have given us 3 triggers by default but it not necessary to use all three every time, we can use any one as per our requirement.
 
There are additional triggers also, all these triggers come under “User Events” category in activity panel,
  1. System
  2. Mouse
  3. Click Image

Summary

 
Today we learned about UiPath studio’s ready-to-use trigger based automation template. Using this template we can trigger multiple actions on screen.


Similar Articles