Question

Loop > GoTo Next


Badge +1

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

Userlevel 3
Badge +6

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”.

 

 

Userlevel 7
Badge +13

Hi @Papou ,

 

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

Badge +1

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.

Badge +1

Hi @Padmakumar 

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

Userlevel 7
Badge +13

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.

Reply