How to read subject from outlook mail in uipath

To read the subject of an Outlook email using UiPath, you can follow these steps:

Method 1: Using the Get Email activity

  1. Add a Get Email activity to your workflow.
  2. Configure the activity to connect to your Outlook account.
  3. In the Get Email activity, set the Search Criteria to Unread or All depending on your requirement.
  4. In the Get Email activity, set the Folder to the folder where you want to read the email from (e.g., Inbox, Sent Items, etc.).
  5. Add a Get Property activity inside the Get Email activity.
  6. Set the Property to Subject.
  7. Run the workflow.

The Get Property activity will return the subject of the email as a string.

Method 2: Using the Get Email Message activity

  1. Add a Get Email Message activity to your workflow.
  2. Configure the activity to connect to your Outlook account.
  3. In the Get Email Message activity, set the Email Message property to the email you want to read.
  4. Add a Get Property activity inside the Get Email Message activity.
  5. Set the Property to Subject.
  6. Run the workflow.

The Get Property activity will return the subject of the email as a string.

Example Code

Here's an example code snippet that demonstrates how to read the subject of an Outlook email using the Get Email activity:

<Activities>
  <Get Email>
    <SearchCriteria>Unread</SearchCriteria>
    <Folder>Inbox</Folder>
    <Get Property>
      <Property>Subject</Property>
    </Get Property>
  </Get Email>
</Activities>

And here's an example code snippet that demonstrates how to read the subject of an Outlook email using the Get Email Message activity:

<Activities>
  <Get Email Message>
    <Email Message> outlook://Inbox/1234567890</Email Message>
    <Get Property>
      <Property>Subject</Property>
    </Get Property>
  </Get Email Message>
</Activities>

Note: Make sure to replace outlook://Inbox/1234567890 with the actual email message ID or path to the email you want to read.