Need help with UiPath robot to process emails with attachments

Hi everyone,

I’m working on developing a UiPath robot that needs to process incoming emails with attachments, extract information from them, and use it in an automated workflow. I’d like to know the best way to:

  1. Trigger the robot when an email is received (for example, using “Outlook Mail Trigger” or another method).
  2. Retrieve and loop through emails to check for attachments.
  3. Extract information from the attachments and process it.

I’m open to any suggestions on best practices and which UiPath tools/activities are best suited for this task.

Thanks a lot for your advice!

Hi @Soudios please below steps :
1.Use get outlook activity to retrieve emails, either filtered by date, subject, or unread status.
Store the emails in a List variable.

2.Use a For Each loop to iterate through the list of emails retrieved.
Inside the loop, check whether the email contains attachments using the mail.Attachments.Count property.

3.check if email has attachment and Use the Save Attachments activity to store attachments in a specific folder. You can specify a directory to save files, either temporarily or for future use.

4.use regex or string manipulation to extract the relevant information.

hi @Akash_Javalekar1

Do you have a sample ?

sample means can you elaborate?

do you have an example (xaml file) ?

i need to create if you have data then send me i will create workflow or you can try steps i have mentioned will try to resolve if you facing any issue

i just need the main process

the trigger is when a new email arrive (do while or for each) what is better ?

Then you can use trigger email activity it will trigger when new email received

i am using state machine, i have this issue

Yes trigger email activity should be in start of the process why you are using state machine?

i prefer, i always using state machine

You can try with integration service as well to trigger the emails

Can you share your workflow so i can understand your workflow will give the solution

Hi @Soudios ,

You can use integration service and use Microsoft Outlook 365 connector to build a connection. Next, you need to create a trigger based on your requirement. It will help you run the job as soon as an intended email is received.
For other tasks, you may use outlook activities to retrieve email, save attachments and string manipulation can be utilized for extracting needed information.

@Akash_Javalekar1 @Anjani_Kapoor
can you send me an xaml file plz ?
its easier for me to user a trigger on UiPath not on the orchestrator

Okay give me some time will send you in sometime can you share attachment for testing ?

test.txt (4 Bytes)

What you want to extract its only text

for attach document i just want to save it on a specific folder in my laptop, but i want to get information on the mail

Hi @Soudios email trigger is not working I tried in flowchart and state machine both this activity should execute in first before process start in am attaching workflow for your reference as i have workaround i hope that will solve your issue


Email_Trigger.zip (2.9 KB)