Breaking a For Each loop with a Flow Decision

Hello everyone!

I’m sure this has been asked before and I know I’ve searched but can’t really find what I’m looking for.

The flowchart below will create a DataTable from an excel sheet and then move on to a ForEach loop for each row in the DataTable.

I’m trying to figure out how to stop the loop and contiune on to the Flow Decision for each Row in the DataTable. Is this possible? Should I come at this another way?

Inside the Read table and process change sequence I have a variable set to True, this True is set to the Flow Decision and I was thinking it would continue on but it doesn’t. It won’t break out of the loop. Is there a better way to do this? I feel like i’m not doing this right.

Much appreciate the help!

~James

1 Like

hi @Nerd use if something and then use Brake this will stop your loop and go to next flow

1 Like

Use this activity to break the loop once your condition met to exit

Thanks!

1 Like

I need it to break the loop and go back to the next row in the datatable. If I add the break to the if statement and point it back to the for each sequence it will start at the same row every time. How do I get it to process the flow for every row in the datatable?

1 Like

For Each row will automatically go to next record once all the steps are completed inside the body.

No need to use break activity in your case.

@kadiravan_kalidoss Is there a way to have it break out of the for each loop and process the flow decision and then start at the next row of the data table in the for each loop? Right now it will either process every row and not go to the flow decision or if i add the break it will go to the flow decision then if i point it back to the for each sequence it will just start at the same row again.

You have to keep all the necessary steps for each record you want to perform inside the body of for each row activity.

Thanks!

1 Like

So I would have to build the flow decision inside the body of the for each loop? And everything related to it making decisions would have to stay inside that loop?

yes…! you are on right track now… please proceed.:dizzy:

1 Like

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