uipathuipath-studiouipath-robotuipath-activity

How do i extract text from email body using UiPath?


I would like to know how do I extract the password form the email body. The password is used to open files in the attachment. How should I approach this? Do I extract the password and store it in an excel file or is there a better way to open the file and store the data.

Below is an example email

Example email
From: ABC <abc@outlook.com>
Sent: Monday, 5 October 2020 10:54 AM
To: BCD <bcd@outlook.com>
Subject: Files

Attached files

The password is: ABCDE


Solution

  • Assuming the password is always 5 characters long, you could get the email body and split it like this:

    split(emailBody, "The password is:", 5)
    

    enter image description here

    enter image description here

    You could then store the output in a variable to be used when opening the excel file.