Problems with Business process loop and list

Hi,

I have a bot that receives a file in outlook, and filters content from the mail into a list. Say for instance that I want $list.get(4), $list.get(6) depending on some set conditions.

Workflow:
Open outlook, fetch email content.

  • No more e-mails, end Business Process
    Filter file from e-mail and set variables.
    Process content and put it into a form. Complete form.

After form is completed, the bot goes back to outlook, to fetch email content if there are more e-mails.
The problem arises after first loop.
I read the file from e-mail and put the content into a list, right. After the first bot loop, the list is in the range of 0-17.
After the second loop, the list is in the range of 0-33, and so on. So for the second loop, I have opted to have an index increase by 17 at the end of each loop; and put it in the get-function, i.e. ${list.get(4+${times})}. It does not work.

Is there a way to have the bot go back to a “clean-slate” when it goes back to the first process in the Business Process?

Hi @jonathanmLbvvH could you share your recording here?

Hello,

You could use this clever little Custom Action to clear the list when you are finished processing each email. That might work for you.

1 Like