Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
6,605
This blog post is part of the SAP Intelligent RPA 2.0 Best Practices Series.

This blog post explains Outlook features in SAP Intelligent RPA 2.0 using Low Code/No Code approach.

 

For latest updates on the Outlook please refer to the store sample.

Functionalities covered in the Blog Post


 

1.Search Emails.

2.Read the Email Content (Get Subject, Get Body, Get Sender)

3.Download the email attachments and save them in the specified location.

4.Using Logic Controls (Forever, Each)

 

1.Add dependencies to the Project


      To access the Outlook Activities, make sure to add Outlook SDK as a dependency to the project.


      Repeat the steps to add the core library.


Once the dependency is added, You can view the Outlook SDK under Dependencies TAB.


 


 

2.Create an Automation


SAP Intelligent RPA 2.0  has features available in the Cloud Studio to create automation.



 

 

3.Explore Outlook Activities and Logic/Controls


 

Step 1: Activity-Open Outlook instance


Initializes the Outlook Instance.

Step 2: Activity -Search Email


Search the mails with the specified criteria.

Step 3: Activity -Get Number of Email Items in Context


Gets the number of mails available in the Context which satisfies the Search Condition

Step 4: Activity -Log


Displays  the number of emails

Step1-Step4



 

 



 

 

Step 5: Activity -Forever.


Use the Logic Control Forever to read the Email content of all the emails.

Step 6: Activity-Is Context Current Email Not Exist.


Activity retrieves false if there is no email in the context.

Step7:   Logic/Controls-Condition.


Condition is mapped to the output parameter isContextCurrentEmailNotExist.

Step8-Activity-Log


Displays the message “Emails not found”

Step 10-Step 16 -Activities Get Subject, Get Sender, Get Body and Log


Activities to read and print the Subject, Sender and Body.

Step 18-Activity-Save All Attachments


Saves all the attachments to the specified path.

Step 19-Logic/Controls-For Each


Loops through the attachments.

Map the Looping List to the output parameter of Step 18.

 


 

Step 20-Activity Log


Displays the Attachment Name

Step 21-Activity-Get Next Email Item in Context


Reads the Next Email Item.

Step 22-Activity Log


Step 23-Release Outlook Instance


Releases the Outlook Instance

Step 24-Activity -Open Message Dialogue


Opens a Message Dialog. Different types of templates are available.

 


 

Recording of the steps from 5-24

 



 

 

 

Complete Workflow



 

 

Save and Deploy the Project.

 

Test Results:


Click on Test Button to view the output.

The BOT would read all the emails matching the selection criteria, Reads the Subject, Email Content, and saves the attachments in the specified location.

Test Results


 

 



 

Further information links


Find more information on SAP Intelligent RPA:


Exchange knowledge: SAP Community | Q&A | Blog

Learn more: Webinars | Help Portal | openSAP

Explore: Product Information | Successful Use Cases

Try SAP Intelligent RPA for Free: Trial Version | Pre-built Bots

Follow us on: LinkedInTwitter and YouTube

 

 
21 Comments
PPX
Advisor
Advisor
0 Kudos
What a great blogpost with clear explanations !
former_member31907
Participant
0 Kudos
Very Informative! Many Thanks for sharing..
chirihan_chergui
Explorer
0 Kudos
Thanks Priya! this is very helpful
WernerJ
Explorer
Perfect. Nice work.

Good explanations good videos.

Including a "test" video as proof makes the blog even more helpful.

Completed and tested with a few test emails in my trial account. Thumbs up.
Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos
Thanks every one!!
former_member690796
Participant
0 Kudos

Dear Priya,

very very informative and usefull.

I was practicing with your example. Somehow the activity “Move Email” made the whole process collapse.

When adding move email in the default branch with the activity “Get Next Email Item in Context” the forever loop will end even though only one of the two emails was processed.

When adding move email in the default branch without the activity “Get Next Email Item in Context” the forever loop will process again and again the first email of the context and will never start the forever loop activities for the second email.

In my automation I wanted to start the process once a day and I wanted to make sure that only the emails received in the meantime are being processed. Do you have another solution instead of moving emails to only process the newly received emails?

Edit1: The same accounts for the activity “Delete Email”.

Edit2: A workaround solution for my last question would be adding the "is read" operand as a search criteria and the "set read" activity in the loop.

Best regards,
Lars

Hi,

When you're moving emails, the current pointer is lost so you need to again get to the beginning of the list (or the end of the list) to get the next one. The below screenshot shows an automation pattern.

Best,

Xiaohui Xue

former_member690796
Participant
0 Kudos

Thanks for the fast reply!

I built the same process like you did, but somehow there is a failure to move the second email.

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert

Hi larshep :

Move Email or Delete Email activities change the Context collection. If you want to move/delete multiple emails, please have a look at the documentation.

Please check the workflow to use the Move/Delete Email Activity.

I was able to move multiple emails. Let me know if you face any issues.

former_member690796
Participant
0 Kudos
This one worked! Thanks a lot 😄
0 Kudos
Hi chaitanyapriya.puvvada

Thank you for tutorial videos. It’s a really good videos to understand most of the outlook features.

Could you please help me to understand;

How to send Custom Emails such as I would like to add HTML body message(specially mailto with a button) to my mail. Like;

<p> Test message </p><p> <a href=”mailto:MyEmail@adress.com.tr?subject=Request Approved &body=Hi, irfan”>Approve </a> <a href=”mailto:MyEmail@adress.com.tr?subject=Request Rejected &body=Hi, irfan”>Reject </a></p><p>The link will only work if you click.</p>

 

Thank you for your help,

Best Regards.
0 Kudos

Hi Chaitanya,

I have experiencing this while sending email. how to remove this notification window.

Regards,

Jeorge

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi


jeox1779,


Please follow the below steps in Outlook and make sure that your Anti Virus status is Valid. If not,please check it with your IT dep to make it valid.



In outlook Naviagte to File-->Options--Trust Center-->TrustCenterSettings




Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos
Hi

irfan.demircioglu.


Please refer to the below blog to send a customized emails.








0 Kudos
Hi chaitanyapriya.puvvada ,

Can you help me understand how we can use hasAttachment & isRead Email Search Criterion? I mean what are the expected input for the operand and value field?

Here is one of my question on the community

Thank you.
Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos
Please refer to this documentation.
liskaj01
Participant
0 Kudos
Hi Chaitanya, thanks for the blogs, was very helpful when I was creating similar workflow. I have already solution that saves pdf attachments and puts their names to the excel file. If there is no attachment, mail is put to folder for manual processing. Now there is a new request. If there are incoming e-mails with pdf attachments but also attachments other than pdf (e.g. .doc), the mail should be moved to another folder for manual processing. However I was not able so far to find out how to solve this. Do we have to solve this via writing some custom script embeded into the workflow? Thank you in advance.
Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos
jaryn,


Based on your conditions (No Attachment/Only PDF Attachment/PDF and Word) , you can use Move Email activity to move emails to different folders.


Refer to the documentation for the activity.


I am attaching a very rough sketch of the workflow of how the email can be moved based on the conditions.

You can include this condition in your workflow and try it out.




Documentation for Condition
liskaj01
Participant
0 Kudos
Thank you, I have been playing with it for a while, but does this approach need some coding? Condition expression - edit formula? Because the condition based on mail attachment has in standard drag & drop and no code approach only Yes/No (1/0) possibilities.
shivamshukla12
Contributor
0 Kudos

Hi @chaitanyapriya.puvvada,

 

If i wanna read content of the email attachment - how can i ? please suggest.

 

thanks,

Shivam

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos
shivamshukla,

To read the content of an Email attachment,you need to Save the attachment using Save Mail Attachment Activity  and use Read File Activity to read its content