How to read email attachments and check if attached file contains a specific word then move this file to a specific location in my computer using gmail activities

I am using Gmail activity to read emails and download attachments in my local machine. I want to check if a specific word (e.g, invoice) appears in PDF, then move it to INVOICE folder and if it contains QUOTATION then move it to quotation folder.

Note: Invoice and Quotation words will be in PDF contents (not the name of the file)

Hi @Bilal_Anwar

If the files are pdf, then u can use read pdf activity in UiPath to acheieve this

if there are types of files, then create a switch condition according to extensions

Thanks & Regards,
Nived N

1 Like

Hey @Bilal_Anwar
After you download the pdf attachment from gmail you can you read pdf activity you will get it in string
Then you can use boolVal = pdfStr.contains(specific word (e.g, invoice).tostring)
use if contion in True move to That folder invoice similarly use for quotation to move to quotation folder.

Cheers.

8 Likes

Is it possible to check pdf files before downloading so that i do not have to download other attachments?

Is it possible to check pdf files before downloading so that i do not have to download other attachments?

No :slight_smile: @Bilal_Anwar

1 Like

No that is not possible bro @Bilal_Anwar
But if there is something on email body or subject then you can explore that i.e for that subject you download the attachment.

Regards.

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