How to filter mails in outlook using uipath

To filter emails in Outlook using UiPath, you can use the Outlook activity and the Search method. Here's a step-by-step guide:

Prerequisites:

  1. You have UiPath Studio installed and configured.
  2. You have an Outlook account set up on your machine.
  3. You have the Outlook activity installed in your UiPath project.

Step 1: Create a new UiPath project

Open UiPath Studio and create a new project.

Step 2: Add the Outlook activity

In the Project panel, right-click and select "Add Activity" > "Outlook". This will add the Outlook activity to your project.

Step 3: Configure the Outlook activity

In the Outlook activity, configure the following settings:

Step 4: Use the Search method

In the Outlook activity, click on the "Search" method and configure the following settings:

Step 5: Filter emails

In the Search method, you can use various filters to narrow down the search results. For example:

You can combine multiple filters using logical operators (e.g., AND, OR).

Step 6: Iterate through the search results

Once you've configured the search criteria and filters, you can iterate through the search results using a For Each loop.

Step 7: Process each email

Inside the For Each loop, you can process each email using various activities, such as:

Here's an example code snippet:

<Activities>
  <Outlook>
    <Search>
      <SearchCriteria>Subject Contains "specific subject"</SearchCriteria>
      <SearchScope>Current Folder</SearchScope>
    </Search>
    <ForEach>
      <Variable>email</Variable>
      <Collection>Outlook.SearchResults</Collection>
      <Loop>
        <Read Email>
          <Email>$(email)</Email>
        </Read Email>
        <!-- Process email content here -->
      </Loop>
    </ForEach>
  </Outlook>
</Activities>

Note: This is just a basic example to get you started. You can customize the search criteria, filters, and processing activities to fit your specific requirements.