How to get filtered mail message jn uipath

To get filtered mail messages in UiPath, you can use the Get Messages activity from the Email category, and then use the Filter property to specify the filter criteria.

Here are the steps:

  1. Add the Get Messages activity to your workflow.
  2. Configure the activity to connect to your email account (e.g. Outlook, Gmail, etc.).
  3. In the Filter property, specify the filter criteria using the Search syntax. For example:
    • To get all emails with a specific subject, use: subject:"Your Subject"
    • To get all emails from a specific sender, use: from:"[email protected]"
    • To get all emails with a specific keyword in the body, use: body:"keyword"
  4. You can also use advanced filter criteria, such as:
    • from:"[email protected]" AND subject:"Your Subject"
    • body:"keyword" OR body:"another keyword"
  5. Run the workflow, and the Get Messages activity will return a list of filtered email messages.

Here's an example of how you can use the Get Messages activity with a filter:

Get Messages
  - Connection: Outlook
  - Filter: subject:"Your Subject"
  - Get Messages: True

For Each Message in Get Messages
  - Log Message.Subject
  - Log Message.Body

This workflow will get all emails with the subject "Your Subject" from the Outlook account, and then log the subject and body of each email.

Note: The Get Messages activity returns a list of MailMessage objects, which you can then iterate over using a For Each loop. Each MailMessage object has properties such as Subject, Body, From, To, etc. that you can access and use in your workflow.