flow designer for each loop, how to add logic to close Request?

Khalnayak
Tera Guru

Hello,

 

I have a for each loop to add users to AD group, and that works fine.

However, I need to add logic to the flow, so the request is closed if users are added to ad group successfully.

It does not have to be all the users from list collector, but as  long as some are added I want the request to be closed complete.

Now if i add the if logic to check if status was success within the for each loop then it will change the state of the request for each user it adds?

see my flow below, where I have moved the if step and update record step out of the for each loop...

find_real_file.png

, but here also it does not work. as the runtime value does not equate to success, but equates to {0}??? im not sure why this is, maybe because I am checking outside the for each loop? 

 

find_real_file.png

 

ccan someone provide a suitable solution here please?

14 REPLIES 14

Jimmie Odelius
Giga Guru

Hi Khalnayak,

It's actually very easy to do. Simply add an End-flow logic action into the for each loop. The End-action will terminate the flow immediately and skip future iterations of the for each logic.

find_real_file.png

 

See documentation here.

Hi @Jimmie Odelius this doesnt help me unfortunately as adding end to the for each loop just ends the loop on the first iteration and doesnt let all the for eachs run.

it also ends the flow so that the bottom if condition does not even run.

find_real_file.png

Hi Khalnayak,

Sorry I misunderstood your question. I don't know a way to halt after the current iteration in for each-loops.

Khalnayak
Tera Guru

@Ankur Bawiskar @Allen A @Pradeep Sharma @Dan Bruhn @Mark Roethof @asifnoor @Jaspal Singh @Harshvardhan @Ashutosh Munot