Skip to Content
Technical Articles

Step-by-Step Guide to Send Email via SAP iRPA

Hello Everyone,

 

In this tutorial, I would like to share how you can trigger email using SAP Intelligent Robotic Process Automation, aka, SAP iRPA.

 

Prerequisites:

  • Subscription to SAP Intelligent RPA service in SAP Cloud Platform
  • SAP iRPA On-Premise Component Setup (SAP desktop Studio and SAP Desktop Agent)
  • Desktop Agent Tenant Registration

 

Let’s get started now.

 

Create New Project

  • Goto File > Create New Project or press “Ctrl + N

  • Fill in the mandatory details in the pop-up, I have maintained below details for my project
    • Project Name: SendEmail
    • Project Template: Project SAP iRPA v1.0 (pre-selected)
    • Title: Send Email
    • Client Name: SELF (As this was self-learning)

 

Add Outlook Library to the Project

  • Select File and click on Edit Project

  • Go-to Libraries and check Outlook Integration library

  • Click on Save

 

Create New Application and add Pages to it

  • Now let’s add application to our project
  • Click on Applications from Context menu

  • Right click on Application panel and click on Add New Application

  • Select “UIAutomation” in the technology and it will display list of all the Windows application running under “Applications”, as shown below

 

  • Select “Inbox” from the list and click on “Save and Capture Page”

            You can change the application name if you wish, I have kept it as it is

  • Click on Refresh icon beside Pages in the Capture Page pop-up, it will display list of open windows pages for the selected application (outlook in our case)

           You can give any page name, I have named it as pInbox

  • Selected page will be displayed inside your application as shown below

          As you can see currently the page pInbox is in red (error state) reason being we have not                    mentioned any criteria for our bot to recognize the page, let’s add criteria to the page

  • Right click on TITLE under Capture Data section and click on “Add to Criteria”. Criteria helps your bot to identify page

  • As soon as you add the criteria, page will turn into Green as shown below

  • Click on New Email on your captured page to select New Email button

          Once you select it, you will note that New Email is highlighted as blue

  • Right click on highlighted section and click on Associate to New Item

  • You can change the name of the selected items under Parameters, I have renamed it to btNewEmail

  • Now let’s capture a new page for New Email screen, before capturing the page please make sure you open New Email screen on your outlook
  • To capture new right-click on your application and select Capture a New Page

  • Select your new email screen under Pages and click on Scan and Capture. I have named the page as pWindowNewEmail

         *If you are not sure which page indicates your new email screen then open you screen beside            Capture Page screen and control + hover over the new email screen

  • Capture “Name” as the criteria for this page as shown below

  • Select “To” section and right click on it to Associate it to New Item

  • I have named the selection as edTo under the parameter section

  • Similarly capture Subject, mail content and Send button and associate them to new items. For my reference I have named them as edSubject, edBody and btSend

Create Workflow

  • Select Workflow under context menu

  • Right click on your application and click on New Workflow

  • Enter the workflow name and click on save, I will name it as sendEmail1

  • You will note a workflow has been created as below

  • Now we want to start our outlook application so for that we drag and drop Start Application under Activities to our workflow

  • Now click on Start under the workflow, go to properties and select your application under the Activity

  • Now connect Start to your Start Application flow in the workflow

  • Now go to Pages beside Activities, it will display all the pages you have created in your application as below

  • Drag and drop inbox page to the workflow and connect it to Start application

  • Double-click on your page inside the workflow to edit the Activities
  • Once you double-click, you will be navigated to the page activities section as shown below

  • Drag and drop Click activity under Item and attach it to New Email which was highlighted when we created page in our application and click on Save or press Ctrl + S

  • Now let’s go back to workflow designer by click on sendEmail hyperlink as below

  • Now let’s add our new email page to the workflow and connect it to Inbox page

  • Let’s edit new email activities by double-clicking on the page

  • Now let’s add activity to each of the highlighted section
  • Right click on highlighted section for To and click on Set … in the item as we want our bot to set email id in this section

  • Now let’s set email id which we want bot to enter inside Source data under Activity section of Properties

           Note: Source data can also be used to pick the email id at runtime but in our scenario we are             hardcoding it to clear our concepts

  • Similarly set the item for Subject and Mail Content section as well
  • Once bot enters all the data we want it to wait for 2 seconds before clicking on Send button. To achieve this we will set Wait activity now
  • Drag and drop Delay from Flow- Wait to Activities section of your page and set the Delay to 2000 ms as shown below

  • Now right-click on Send button and select “Click on the item” and click on Save

  • Now come back to workflow designer and click on save
  • We have successfully designed the workflow for our bot

Execute the Bot

  • To execute our bot we first need to build and then run our project
  • Click on Build icon  or click Ctrl + B

  • Once Build is success, you will get message as below

  • Now click on Play icon or press F5 to debug the script
  • You will below messages in Desktop Debugger

  • Close outlook so that you can see execution starting from bot opening the outlook
  • Now right-click on Desktop Agent and click your workflow

 

Congratulations !!! You have successfully created iRPA bot to trigger email

 

Happy Learning 🙂

 

 

10 Comments
You must be Logged on to comment or reply to a post.