Technical Articles
SAP Intelligent RPA 2.0 – Explore Outlook features
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
Repeat the steps to add the core library.
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: LinkedIn, Twitter and YouTube
What a great blogpost with clear explanations !
Very Informative! Many Thanks for sharing..
Thanks Priya! this is very helpful
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.
Thanks every one!!
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
Thanks for the fast reply!
I built the same process like you did, but somehow there is a failure to move the second email.
Hi Lars Heppner :
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.
This one worked! Thanks a lot 😀
Hi Chaitanya Priya 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.
Hi
İrfan DEMİRCİOĞLU.
Hi Chaitanya,
I have experiencing this while sending email. how to remove this notification window.
Regards,
Jeorge
Hi
Hi Chaitanya Priya 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.
Please refer to this documentation.
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.
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.
Hi @Chaitanya Priya Puvvada,,
If i wanna read content of the email attachment - how can i ? please suggest.
thanks,
Shivam
Shivam Shukla,
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