Solved

How to loop through sent items in gmail

  • 10 February 2023
  • 9 replies
  • 1551 views

Badge +2

As per the docs portal it mentions to access the folders using [Gmail]/FOLDER. But i’m unable to use this to loop through the sent folder. Is there a solution for this?

If I use [Gmail]/Sent, I get a folder not found error like below

In mailbox [Gmail]/Sent folder not found because aaac NO[NONEXISTENT] Unknown Mailbox: [Gmail]/Sent (Failure)

 

https://docs.automationanywhere.com/bundle/enterprise-v2019/page/enterprise-cloud/topics/aae-client/bot-creator/commands/cloud-email-action-loop.html

  • Gmail:
    • To retrieve emails from the default folders, you must use [Gmail]/FOLDER, except for the Inbox folder.

      For example, [Gmail]/Draft, [Gmail]/Important, [Gmail]/Trash, and so on.

    • To retrieve emails from the folders you have created or the Inbox folder, you must specify the folder names as they are.

      For example, if you have created folders called Bank and Sports in your Gmail, specify Bank and Sports without the [Gmail] prefix to retrieve emails from these folders.

icon

Best answer by Padmakumar 10 February 2023, 10:13

View original

9 replies

Userlevel 7
Badge +13

Hi @Ralph.A ,

 

Are you able to loop through the Mails within INBOX if you specify the name as Inbox in the loop command?

 

Badge

Hello @Ralph.A 

Please try to connect to the mailbox as below and then use a loop action to loop through the folder you want to in your gmail mailbox.

Let me know if it helps. Thanks!

Connect action:


Loop Action:

 

Note: To connect to gmail you need to activate 2factor authentication for gmail account and then create an app password for automation anywhere.
Reference: 

 

Badge +2

There is no need to specify INBOX, by default it loops the inbox, we have to explicitly specify the sent items because the command does not loop through the sent items.

I have tired and tested this and the command does not work on the sent items unless specified 

 

Badge +2

@shibashis001 I’m not looping the inbox but the sent items

Userlevel 7
Badge +13

There is no need to specify INBOX, by default it loops the inbox, we have to explicitly specify the sent items because the command does not loop through the sent items.

I have tired and tested this and the command does not work on the sent items unless specified 

 

Can you try Sent instead of [Gmail]/Sent ?

Badge +2
Using Sent
Using [Gmail]/Sent

I get the same error.

Userlevel 7
Badge +13
Using Sent
Using [Gmail]/Sent

I get the same error.

 

 

Ok. Please check with [Gmail]/Sent Mail. If still you are getting the error, try to list down all folders available in Gmail and see whether the Sent folder written in any native language or not. If yes, you need to specify the same name in order to loop through the folder.

Badge +2

[Gmail]/Sent Mail works

Another question, how do I list the folders available ?

Userlevel 7
Badge +13

[Gmail]/Sent Mail works

Another question, how do I list the folders available ?

 

You can use Inline scripts like Python for the same.

Reply