Filter1 - From Specific Mail id only
Filter2 - I have two datetime variables StartDate and End Date, i woul like to get the mails for only between these two dates.
Please let me know, how to apply above filters in Get Outlook Messages Activity.
To filter emails by sender and date range in UiPath using the “Get Outlook Mail Messages” activity, you can apply filters using the properties panel. Here’s how to set it up:
Drag the “Get Outlook Mail Messages” Activity: Add this activity to your sequence.
Configure the Properties: In the properties panel of the activity:
MailFolder: Set this to “Inbox” or the specific folder you want to search in.
Top: Define the maximum number of messages you want to retrieve.
Account: If necessary, specify the Outlook account to use.
Apply Filter for Sender and Date Range: In the “Filter” property, you’ll need to use a DASL query string to filter emails by the sender’s email address and the date range. Construct your query as follows:
Replace sender@example.com with the specific email address you’re filtering for. The StartDate and EndDate should be your DateTime variables formatted to a string that Outlook understands (usually “g” for general date format works).
Assign Filter to the Activity: Assign the above DASL query string to the “Filter” property of the “Get Outlook Mail Messages” activity.
Output the Results: Store the results in a variable, typically of type List<MailMessage>, to hold the emails that match your criteria.