Skip to main content
Question

Loop > GoTo Next


Papou
Forum|alt.badge.img+1
  • Cadet | Tier 2
  • 4 replies

Hello community, and thanks in advance for your help,

As a daily user of AA solution, I came up with a dev. problem that I’m unable to solve using minimum steps/no intermediary/ solution.

Please allow me to set the scene:

  • Assume that you are looping (read) through your inbox mails,
  • And for each email in your inbox, you are looking for a string that Start with a specific text and Ends with a specific text, while not containing a specific text.

E.g.:  An email Body (dictionary{emailMessage}) where you are looking for a ‘String Extract’ that start with “hello”, end with “world”, while not containing “crazy”.

>

pointless sentence
hello crazy world

hello crazy world
hello super AA world

pointless sentence
>

I’m hence asking my boot to loop through the email body, until it find a string that start with “hello” and end with “world” without “crazy” within it.

Code:

Loop while string “extractBody” does not includes “crazy”.

        String: ‘Extract text’ from ‘emailMessage’ that start after hello and end before world,
        save output to a variable ‘extractBody’.



The answer should be “hello super AA world” but the bot will first find “hello crazy world“ and start over from the beginning for each loop iteration (forever).

That the issue I have: The loop is always restarting from the beginning of the email. 

How can I ask the bot to ‘GoTo Next’ ?

  • I have tried to use the “Continue” or “Break” action.
  • ​​​​​​​I could go through Excel or a Text document, but this adds a lot of steps.
  • I could be using a macro, but I’m willing to keep everything within AA embedded tools.
  • I could be using the “Occurrence” parameters but this is unsteady. 

Hope this make sense, 

Thanks in advance for your help !

5 replies

Forum|alt.badge.img+6
  • Navigator | Tier 3
  • 142 replies
  • March 7, 2023

Loop while string “extractBody” does not includes “crazy”.

        String: ‘Extract text’ from ‘emailMessage’ that start after hello and end before world,
        save output to a variable ‘extractBody’.
The answer should be “hello super AA world” but the bot will first find “hello crazy world“ and start over from the beginning for each loop iteration (forever).

Are you changing the value of string inside loop? If not, it will go on forever if “extractBody” does not includes “crazy”.

 

 


Padmakumar
Forum|alt.badge.img+15
  • Flight Specialist | Tier 4
  • 805 replies
  • March 8, 2023

Hi @Papou ,

 

Can you imitate the Same within a Sub folder rather than doing it on INBOX?


Papou
Forum|alt.badge.img+1
  • Author
  • Cadet | Tier 2
  • 4 replies
  • March 8, 2023

Hi Sumit,

No I’m not since I’m just reading the email: not copying it to another support, not “answering” to the email, etc.


Papou
Forum|alt.badge.img+1
  • Author
  • Cadet | Tier 2
  • 4 replies
  • March 8, 2023

Hi @Padmakumar 

I can but what would that change? The struggle lay within the email itself, not between the emails.


Padmakumar
Forum|alt.badge.img+15
  • Flight Specialist | Tier 4
  • 805 replies
  • March 8, 2023
Papou wrote:

Hi @Padmakumar 

I can but what would that change? The struggle lay within the email itself, not between the emails.

 

It may sound weird. But, if you loop within INBOX, no matter whatever condition you put, BOT will iterate through all available mails within it and the result will not be the same which you are expecting out of it. It will not be the case for a Sub folder.


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