Skip to main content
Solved

How to loop through sent items in gmail

  • February 10, 2023
  • 9 replies
  • 2402 views

Forum|alt.badge.img+3

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.

Best answer by Padmakumar

Ralph.A wrote:
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.

View original
Did this topic help answer your question?

9 replies

Padmakumar
Forum|alt.badge.img+13
  • Navigator | Tier 3
  • 785 replies
  • February 10, 2023

Hi @Ralph.A ,

 

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

 


Forum|alt.badge.img
  • Cadet | Tier 2
  • 3 replies
  • February 10, 2023

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: 

 


Forum|alt.badge.img+3
  • Author
  • Cadet | Tier 2
  • 5 replies
  • February 10, 2023

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 

 


Forum|alt.badge.img+3
  • Author
  • Cadet | Tier 2
  • 5 replies
  • February 10, 2023

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


Padmakumar
Forum|alt.badge.img+13
  • Navigator | Tier 3
  • 785 replies
  • February 10, 2023
Ralph.A wrote:

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 ?


Forum|alt.badge.img+3
  • Author
  • Cadet | Tier 2
  • 5 replies
  • February 10, 2023
Using Sent
Using [Gmail]/Sent

I get the same error.


Padmakumar
Forum|alt.badge.img+13
  • Navigator | Tier 3
  • 785 replies
  • Answer
  • February 10, 2023
Ralph.A wrote:
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.


Forum|alt.badge.img+3
  • Author
  • Cadet | Tier 2
  • 5 replies
  • February 10, 2023

[Gmail]/Sent Mail works

Another question, how do I list the folders available ?


Padmakumar
Forum|alt.badge.img+13
  • Navigator | Tier 3
  • 785 replies
  • February 10, 2023
Ralph.A wrote:

[Gmail]/Sent Mail works

Another question, how do I list the folders available ?

 

You can use Inline scripts like Python for the same.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings