Technical Articles
SAP RPA 2.0: Out of Office (Outlook Automation)
Hi All, I am Hari J N, SAP Intelligent RPA Developer.
Introduction:
We are going to see how SAP Intelligent RPA can help simplify setting Out of Office messages by searching for approval emails of leave applications in Outlook, using simple steps. We will start from creating a project, building the RPA and even testing it successfully.
For the demo, we are taking sample email template of approved leave application and setting the auto replies/ out of office from using the data available in the email like leave From Date, To Date, approver name and email address for setting the auto replies in the Outlook application, along with usage of Try catch blocks, conditional statements, Screen captures in the workflow to show codeless consumption experience that SAP Intelligent RPA provides.
This framework can be used to build and test rapid prototypes. And out of office can be set in Outlook within 20-30 seconds, and building the RPA with easy, very readable configuration steps and test it to see results.
We can also see all the different options like the process, the web capture and automations that are available to us as a centrally accessible bundle from SAP Intelligent RPA 2.0.
Intelligent RPA 2.0 introduced Outlook SDK which allows you to extract data from the Outlook with the help of user-friendly and convenient activities.
Overview:
- In the “Search Mails” automation “Open Outlook instance” is used to open an instance of Outlook for performing outlook related tasks.
- The “custom script” is used to get Today’s date as output from JavaScript code.
- The “Search Email (Outlook)” is used to search emails based on certain list of parameters, for searching approved leaves “subject” parameter should contain “Your Leave Application has been Accepted” and “date Received” should be equal to Today’s date.
- Inside the “Try catch” block “Get Mail Sender” is used to get Name and email address of the sender who will be approving leave.
- “Get Mail Body” is used to get mail body which satisfies the Search criteria’s given in “Search Mail” if no email satisfies the conditions then “Search Mail” returns empty output.
- The “condition” is used to filter when Email Body does not have any data the automation ends by closing and releasing Outlook instance if “Email Body” has data then another custom script is used to extract “From Date” and “To Date” from the email body and stored as “Start Date” and “End Date” to be used while setting Auto replies automation.
- The “Auto Replies” automation which has the screen captures of Outlook application performs set of “click element” and “set element” on the declared elements in the capture pages to set auto replies.
- The “Start Application” is used to start Outlook application by giving target as Outlook.
- Set of “wait”, “click” and “set” elements are used to set Auto replies in outlook.
The final automation workflow:
First Step: Project and Package
We will create a New Project and we generate a Package from the project
. Create a New Project
The SAP Intelligent RPA Core SDK is required. So make sure this package is added to your project. If the Core SDK package is not available on your tenant, you can acquire it from the Store
. Next Step: Select Dependencies – Manage Dependency and Add Dependency
. After Adding the Dependencies will get the packages List shown in the below image
. Next Step is Automation
. Select Create – Automation
. The Configure agent version is displayed – select your latest version and Confirm
. Next step we will get the below screen and next we will drag and drop the required activities
. First Step in Automation – Drag and drop the “Open Outlook instance” from the Activities
. Next Step in Automation – Drag and drop the “Custom script” from the Activities, it is used to get Today’s date as output from JavaScript code.
. Next Step in Automation – Drag and drop the “Search Email (outlook)” from the Activities, in this “subject” parameter should contain “Your Leave Application has been Accepted” and “date Received” should be equal to Today’s date.
. Next Step in Automation – Drag and drop the “Try Catch” from the Activities, which prevents stopping of execution when search email is empty to get other parameters from the mail.
. Next Step in Automation – Drag and drop the “Try Catch blocks” from the Activities, inside the try catch block Drag and drop the “Get Mail Sender” which is used to get Name and email address of the sender who will be approving leave and “Get Mail Body” is used to get mail body which satisfies the Search criteria’s given in “Search Mail”.
. Next Step in Automation – Drag and drop the “Condition” from the Activities, it is used to filter when Email Body does not have any data.
. Next Step in Automation – Drag and drop the “Custom script” from the Activities to extract From date and To date from email body and then Drag and drop the “Auto Replies” automation.
. Next Step in Automation – Drag and drop the “Close Outlook instance” and “Release Outlook instance” from the Activities
. Auto reply Automation Process – First “Start Application” is used to start Outlook application by giving target as Outlook then “wait” is used to wait until the element is available to perform action then “File Tab” is clicked to go to home page and then “Auto Replies” button is clicked then in Auto Replies form “Set Auto Replies” is enabled by “click” and the “Start Time”, “End Time” and “Message” is set by giving the extracted values from “Search Mails” automation and then “OK” is clicked and application is closed.
. Capture the outlook screens by creating a new application in the project
Leave Application Template
Results of this Automation
Link to the running bot with details
Conclusion:
We can set Out of Office messages. very easily using automations, screen captures, creating Data Types from SAP intelligent RPA 2.0 with codeless experience.
With this blog post, the intention is to get customers, business managers and RPA developers into thinking about using SAP Intelligent RPA 2.0 into various automation opportunities by showcasing the simple steps required to achieve great results. Also, to start the conversation about utilizing the various options available within SAP Intelligent RPA 2.0 to make these scenarios a reality.
This automation will benefit the roles business Process Lead, Business Process Analyst, Business Process SME, Process Executioner.
I hope you found this tutorial helpful. Please provide feedback in the comment section and feel free to ask any questions in the SAP Intelligent RPA Q&A area (link for reference: https://answers.sap.com/tags/73554900100800002142)
Hi, good job with this blog post! Good luck in the tutorials challenge 🍀