One Email - Multiple Attachments

Hello Everyone,

I just have a general RPA question. Here is the scenario:

A company gets sent invoices/ PDFs for grocery store purchases. However, it is tedious for the grocery store to send over 1 mail with just 1 pdf attachments that needs to be processed. I am wondering if it is possible in UiPath to process multiple pdfs from 1 mail? (I am using outlook). I have done some research and I know that you can send outlook mail messages with multiple attachments, but haven’t found anything concrete yet on processing multiples ones. My initial thought process is to have the bot save all the attachments to a folder and use each downloaded pdf as a transaction from there. Any advice/ thoughts? Thank you!

Hi @Mike_Brown1

It is possible to send multiple pdf attachments in a single outlook mail. All you need to do is sending the filePathCollection variable to the Send Outlook Mail Message activity, instead of single file path.

filePathCollection variable will be of a type System.String (i.e. an array of string) & you can save multiple file paths like this:

filePathCollection = {filePath1, filePath2, filePath3,….}

This variable can be passed to AttachmentsCollection property of the mail sending activity & you are good to send multiple attachments.

Hope this helps,
Best Regards.

Hi @Mike_Brown1
You can send multiple attachments by using “Attachments Collection” you can pass the folder contains different files. Please find below ss for your reference.

Regards,

Okay, It looks like I wasn’t clear with my question! What I meant is this - Say Company Z gets the mail with 5 pdf attachments that need to be processed. Is it possible for the bot to read that mail and process all those attachments? Or can it only be one pdf per mail that can be processed?

Thank you!

Hi @Mike_Brown1

Can you try this-

1 use an “If” condition within the loop to check if the email contains any attachments. You can use the condition item.Attachments.Count > 0.
2. If there are attachments, create a folder to save the attachments.
3. Use another “For Each” loop activity to iterate through each attachment in the email.
4. Within the loop, save each attachment to the folder
5. After saving the attachments, you can use another loop or separate logic to process each PDF as a transaction.

Thanks!!

Hi @Mike_Brown1
Yes it is possible to process all documents in mail by using for each to loop all documents.
Please find below image for your reference.

Regards,

hi @Mike_Brown1 ,

You can save all the attachments from a mail.
And using a loop on all the attachments you can process them as need be.

regards,
Aditya

Thank you so much to everyone for your feedback! :slight_smile:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.