Thursday, September 12, 2019

RPA UIPATH: Use delay and check outlook mail every 5 minutes/required interval

Requirement: Delay the UIPath execution
Solution: TimeSpan.FromMinutes(5) -- delays 5 minutes
                Similarly you can delay for days, hours, minutes, seconds, milli seconds

*------------------THE END(IF YOU ARE LOOKING JUST FOR ABOVE INFORMATION)--------------------*

Below is the image/setup for read outlook mail inbox every 5 minutes and display subject



HOW TO SET OUTLOOK MESSAGE FILTER IN UIPATH / FILTER MESSAGE BY DATE

Requirement: Display all mails received today
Solution:  "[Received]>'" & now.ToShortDateString & "'"


*------------------THE END(IF YOU ARE LOOKING JUST FOR ABOVE INFORMATION)--------------------*


I am sure if you are searching for filters you know how to read messages from outlook,
however for new learners providing steps below.

1. Drag drop "Sequence"
2. Drag "Getoutlook mail messages" into sequence, set it up as per requirement1 or 2 shown below
3. Drag for each and provide any variable before "in" and output variable in step 2 setup and change it to mail message type in properties as shown in below image
4. YOU ARE DONE!!  Inside the body of for each, add code whatever you want !!

Reference:




Requirement1: Display all mails received today
Solution:  "[Received]>'" & now.ToShortDateString & "'"



Requirement2: Display all mails received today and has excel attachment
Solution:  "[Received]>'" & now.ToShortDateString & "' and [attachment]='*.xls*'"


For more outlook filters check: https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2007/cc513841(v=office.12)?redirectedfrom=MSDN