How to check mail attchment have specific keyword

I need to check outlook mail attachment having “Invoice no” keyword or not. if that attachment having the keyword then only bot need to download the attachment.

@BNK

Once you get the mail…say in mail variable …use below in if activity to check

mail.Attachments.Count>0 AndAlso mail.Attachments.Any(function(x) x.Name.ToLower.Contains("invoice no"))

on the then side you can save the attachments and on else the attachments dont match your requirement

cheers

Hi @BNK

→ Use Get outlook mail message or Get IMAP Mail message activity to retrieve the mails and store in a List of Mail messages datatype variable, let’s call the Variable name as MailMessage.
→ Use for each activity to iterate the each mail in the MailMessage variable.
→ Inside for each insert an If activity to check the condition.

- Condition -> CurrentItem.Attachments.Any(Function(X) X.Name.Contains("FileName"))

→ Insert Save attachment activity in then block to download the attachments in the mail.

Note - There is no option to download the only one attachment, save attachments activity will download all attachments in the mail. You need to filter out there by using for each file in folder activity to get the required file.

Check the below workflow for better understanding,

Hope it helps!!

It is checking the attachment name. But I want to check inside the attachment. So, Any possibilities in UiPath.

It is checking the attachment name. But I want to check inside the attachment. So, Any possibilities in UiPath(RPA).

What is the type of File Attachment… @BNK

@BNK

Inside attachment you need to save and check…without saving you cannot…save it read and check…if required keep it else delete

cheers

1 Like

It is word document(.docx).

@BNK

Try below Activity for Word Document

Cheers!!

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