Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Wait for Condition for Multiple Change Tasks

Anshul Agarwal
Tera Expert

I am developing a flow using Flow Designer. I have a requirement where I need to check if all the tasks in the change are closed before we move to the next step in the Flow. I am trying to use "Wait for Condition" but I am not able to get it working. In my case, number of tasks could be dynamic and for a change there could be either 1 or 2 or 3 tasks. Because of this, I cannot select the Task Record in Wait for Condition as I don't know how many change task records are there. I tried creating a script in wait for condition but that also is not working:

 
Tried Look Up Records to filter all the Tasks in a change and then use For Each loop but again got stuck at wait for condition below:
 
find_real_file.png
Any suggestions on this?

 

6 REPLIES 6

Ankur Bawiskar
Tera Patron
Tera Patron

@Anshul Agarwal 

steps you can try

  1. Use "Look up Records" action for sc_task table to find all records that matches the request_item.
  2. Use action "For each item in" above results
  3. Use action "Wait for condition" where Active is false.

Reference: https://community.servicenow.com/community?id=community_question&sys_id=6334dec8dbadb700feb1a851ca96...

find_real_file.png

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Anshul Agarwal
Tera Expert

Thanks for response Ankur. I am actually looking this for Change Task. For Change task, I do not see a relationship in Change table. On Change Task, there is a Parent relationship to Change hence Wait for Condition on Change table is not working as well.

Anshul Agarwal
Tera Expert

Also, when I am trying to put Change Task table in the Flow, it does not allow:

 

find_real_file.png

Hi,

when you use data pills what it shows?

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader