Skip to main content
Question

The bot only reads one mail and finish "successfully"


I have a process that involves reading unread mails from a specific mail folder, the problem is that the loop (for each unread mail in mail box) is supposed to do something with each unread mail, but the bot only reads one mail and finish "successfully" as if in the folder there was only one mail but it is not like that.

 

I did the following test just to verify that it was not a coding error and the bot still only reads one email in the specified folder even though there are more.

 

NOTE: Previously it was working properly and then it just stopped working as it should.

 

14 replies

Badge +1

Imagen1 

Screenshot 2022-08-02 023810

Badge +1

@9thakan @Nadia Ayala  happening for me… how did you resolve this?

is it because of the missing disconnect statement?

Userlevel 5
Badge +9

@9thakan @Nadia Ayala  happening for me… how did you resolve this?

is it because of the missing disconnect statement?

 

It’s necessary close the email session because it can stuck threads with your email provider  and it  getting unavailable for a while

Userlevel 3
Badge +6

Dear @9thakan /@yreddy,

 

If read unread emails from a specific mail folder and the bot is only processing one email even though there are more unread emails in the folder, there are a few things you can try to troubleshoot the issue.

First, make sure that the loop that you are using to read the emails is properly configured. In particular, you want to make sure that the loop is set up to continue running until all of the unread emails in the folder have been processed. You can do this by using a "while" loop and a counter variable, as described in my previous response.

Next, check the settings of the email folder that you are reading from to make sure that the bot has the necessary permissions to access and read all of the unread emails. In Automation Anywhere, you can use the "Get Mail Messages" action to specify the email folder and the criteria for selecting the emails that you want to process. Make sure that you have selected the correct email folder and that you have set the criteria to include all of the unread emails in the folder.

Additionally, you can try running the bot in debug mode to see if it is encountering any errors or issues when reading the emails. In debug mode, the bot will pause at each step and display the output of the actions, allowing you to see what is happening and identify any problems. To run a bot in debug mode, select the bot in the Control Room and click on the "Debug" button

 

Regards,

 

Userlevel 7
Badge +13

Hi @9thakan ,

 

Could you please check whether these skipped unread mails have subject or not. If the mail was skipped because of no subject, try the below thing.

 

By using emailSubject dictionary variable you can read the subject from the emails.

Please use if condition with email subject, for example,

 

if emailSubject is empty and elseif not equal to empty

Badge +1

@9thakan @Nadia Ayala  happening for me… how did you resolve this?

is it because of the missing disconnect statement?

 

It’s necessary close the email session because it can stuck threads with your email provider  and it  getting unavailable for a while

@Raul Jaimes yeah but still facing it, but it’s not continuous, it occurs only in certain cases.

Sequence of events which caused this 

  1. loop through email folder “EmailTest” (note: All emails are selected)
  1. total 10 emails are placed
  1. During execution, all 10 emails are picked up and 2 emails are moved to “Completed” folder based on business logic
  2. Now, EmailTest folder has 8 emails
  3. I have moved 2 emails from “Completed” to “EmailTest” folder again, total 10 emails in “EmailTest” folder now.
  4. Restart the bot and bot picks up only 2 emails, in the loop “All Emails” was selected.

Using Outlook client for connection

Loop contents:

 

Badge +1

Dear @9thakan /@yreddy,

 

If read unread emails from a specific mail folder and the bot is only processing one email even though there are more unread emails in the folder, there are a few things you can try to troubleshoot the issue.

First, make sure that the loop that you are using to read the emails is properly configured. In particular, you want to make sure that the loop is set up to continue running until all of the unread emails in the folder have been processed. You can do this by using a "while" loop and a counter variable, as described in my previous response.

Next, check the settings of the email folder that you are reading from to make sure that the bot has the necessary permissions to access and read all of the unread emails. In Automation Anywhere, you can use the "Get Mail Messages" action to specify the email folder and the criteria for selecting the emails that you want to process. Make sure that you have selected the correct email folder and that you have set the criteria to include all of the unread emails in the folder.

Additionally, you can try running the bot in debug mode to see if it is encountering any errors or issues when reading the emails. In debug mode, the bot will pause at each step and display the output of the actions, allowing you to see what is happening and identify any problems. To run a bot in debug mode, select the bot in the Control Room and click on the "Debug" button

 

Regards,

 

“Get Mail Messages”? I wonder if there’s any command as such in A360

Userlevel 5
Badge +9

@9thakan @Nadia Ayala  happening for me… how did you resolve this?

is it because of the missing disconnect statement?

 

It’s necessary close the email session because it can stuck threads with your email provider  and it  getting unavailable for a while

@Raul Jaimes yeah but still facing it, but it’s not continuous, it occurs only in certain cases.

Sequence of events which caused this 

  1. loop through email folder “EmailTest” (note: All emails are selected)
  1. total 10 emails are placed
  1. During execution, all 10 emails are picked up and 2 emails are moved to “Completed” folder based on business logic
  2. Now, EmailTest folder has 8 emails
  3. I have moved 2 emails from “Completed” to “EmailTest” folder again, total 10 emails in “EmailTest” folder now.
  4. Restart the bot and bot picks up only 2 emails, in the loop “All Emails” was selected.

Using Outlook client for connection

Loop contents:

 

 

Kindly verify if the moved email is the expected. Use a message box to  show the message for every iteration.

Badge +1

@9thakan @Nadia Ayala  happening for me… how did you resolve this?

is it because of the missing disconnect statement?

 

It’s necessary close the email session because it can stuck threads with your email provider  and it  getting unavailable for a while

@Raul Jaimes yeah but still facing it, but it’s not continuous, it occurs only in certain cases.

Sequence of events which caused this 

  1. loop through email folder “EmailTest” (note: All emails are selected)
  1. total 10 emails are placed
  1. During execution, all 10 emails are picked up and 2 emails are moved to “Completed” folder based on business logic
  2. Now, EmailTest folder has 8 emails
  3. I have moved 2 emails from “Completed” to “EmailTest” folder again, total 10 emails in “EmailTest” folder now.
  4. Restart the bot and bot picks up only 2 emails, in the loop “All Emails” was selected.

Using Outlook client for connection

Loop contents:

 

 

Kindly verify if the moved email is the expected. Use a message box to  show the message for every iteration.

Yes, it’s moving the expected email. tried all these things but no luck. Loop stops as if if there’s no other email in the folder.

Userlevel 7
Badge +13

Hi @yreddy ,

 

Have you checked whether the skipped Mails have Subject line or not?

Badge +1

Hi @yreddy ,

 

Have you checked whether the skipped Mails have Subject line or not?

Hello @Padmakumar, skipped emails are having subject lines! 

Userlevel 7
Badge +13

Hi @yreddy ,

 

Have you checked whether the skipped Mails have Subject line or not?

Hello @Padmakumar, skipped emails are having subject lines! 

 

Ok. Have you tried to change the Email package version? If not, please try after changing it. 

Badge

@9thakan   Did you solve this issue? I am facing the same problem here

Reply