GMail extraction


I just want to ask how may I extract the templated subject with corresponding attachments and saved it to the google drive?


1 Like

Hi @rtablate

For this u had to use Get Imap messages activity to retrieve all the messages and store in a Mail Message List variable, let’say mail_list

then iterate through it and inside it use a if condition like mail.Subject.ToString.Equals(“Loisse Joy Delenna”)

if the condition is true, then use the save attachments activity to save the attachments to the specific folder

Hope it helps you

Nived N
Happy Automation

1 Like

Hi @rtablate

Welcome back to uipath community

There are actually three ways to filter the received mails based on subject

  1. If you have the exact subject text then you can mention that in any of the GET MAIL activity (either with outlook or exchange activities) along FILTER PROPERTIES like this
    “[Subject]=‘your text’”

  2. Or if you have a part of subject text we can do it in two ways
    One is directly using this expression in Filter property like this

“@SQL=urn:schemas:httpmail:subject LIKE '%”yourvalue"%’ "


Or without mentioning any expression in filter properties and get the output as List of mail messages from get mail activity with a variable named V_outmsg

Now use a for each activity and pass the above variable and change the type argument as

Inside the loop use a IF condition and use a condition like this
item.Subject.ToString.Contains(“your value”)

If the obtained mail has a subject with that specific text in it then it will go to THEN part where you can download the attachment with SAVE ATTACHMENT activity

Hope this would help you
Pls let know for any further queries or clarification

Cheers @rtablate

1 Like

What will be the value I need to input?

Hi @rtablate

You had to supply the value for Email, Password, server, port to make this activity working

Adding a video for reference

1 Like


Thanks for this. May I ask what is the data I need to input in the properties section?

1 Like

For get Imap mail message actiivty

Email: emailid of account

Password: Password of account

Domain : if it is gmail, then provide

Port : 993

Nived N

Mention below properties
server url-
Username - your username
Password - Your password


We’re using the Gmail for this project, is this compatible with outlook office? by the way do I need to create credentials (new project) on the google cloud platform? this will enable the API’s

Hey, Nived

The "Forwarding and POP/IMAP is not available on my company email. Do we have other workaround for this?

As you are using gmail based mail activity use the above steps and save the file

And for properties
Pls check this thread

Cheers @rtablate


For your checking. What tool will I use?

Go for GET IMAP @rtablate

I can’t generate a password due to this account is for work. Do we have other workaround?

Which service is enabled for you @rtablate
Like is it IMAP or POP3
You can get it clarified from your admin team based on which we can decide which service based activity could be used


I see let me get back to you. I’ll need to ask first on our IT Team which is possible for this project. Have you heard about creating project under Google Cloud Platform for the credentials “Client ID” and “Client Secret” that will enable API’s this is other way to access GSuite application.