How To Gracefully Exit a Loop or For Each in REF to End Workflow or Move to Next Transaction?

I have been trying a few different methods I have seen in the forum but apparently doing something wrong.

When I am using the Framework I need to be able to exit “If” or “For Each” loops gracefully because I technically don’t have any “Errors”.

Scenario 1: Using an If statement in Init to check for email. If email doesn’t exist, I want to send myself and email and end the workflow

Scenario 2: I am in Process performing a for each looking for a match in a large table. Once I find a match, I want to exit the loop and move on to the next Transaction Item rather than continue going line by line since I already have my match.

Appreciate any simple solutions I might be missing for these scenarios. Thanks!

1 Like

For Scenario 1: You are check the mailbox unread only right ?, Why cant you check the count of mails in folder and proceed with your flow

For Scenario 2: Have you used Break Activity ?

@karthick well that seems simple enough for Scenario 2 :man_facepalming: Apparently I was overthinking that one.

On Scenario 1, I am grabbing an attachment to load into TransactionData. As I type this I see what you are saying…If TransactionData is nothing it should end but I am getting an error and stopping. Hmm, let me look into this one more.

Thank you for the response.

Can you share the error here, so that we can look in to it.

@karthick suddenly Scenario 1 decided to work! :roll_eyes: :grinning: Thank you for responding. Maybe I just needed to type it all out!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.