We're reclaiming inactive PDIs to keep them available for active builders. Learn what's changing, who's affected, and how to protect your work. Read More

How to avoid using for each in flow designer ?

kiran kumar m1
Tera Contributor

image (9).pngimage (8).pngimage (7).pngI have a catalog in which , multiple users request a software or single user requests multiple softwares ,
in the flow i want a managers approval , if suppose three users were selected , then it should create three manager approvals , for which i did the lookup in sys_user table , there in the condition I have written a script 

"var uid=fd_data._1__get_catalog_variables.requested_for2;
var query = "sys_idIN" + uid;
return query;"

this script will fetch the sys_ids from the list collector type variable , then I have written a for each which will take each sys_id and it will create  a approval record for it 

once this approvals are created , when each approval is approved I want a task should be created , 
but here as I am using for each , its picking a random sys_id / picking in ascending order ,
until and unless i approve the approvals in order the next task generation is not happening as expected is there any way I can overcome this 




 
 
 

 

 

 

6 REPLIES 6

Ehab Pilloor
Mega Sage

@kiran kumar m1  

Try single Approval action, use rule as All Users Approve or Reject, code the logic in Rules based on sys ids you have collected.

 

Please Accept this response as Solution if it assisted you with your question & Mark this response as Helpful.

 

Kind Regards,

Ehab Pilloor

yashkamde
Mega Sage

Hello @kiran kumar m1 ,

 

If you want to achieve parallel approval then have a look on this approach :

How to ask for approval in parallel using Flow designer from a list collector 

 

If my response helped mark as helpful and accept the solution.