Proper way to wait for Change Closed or Cancel condition

ILYA STEIN
Tera Guru

I am creating standard change requests dynamically in a Flow Designer flow in response to a user submitting a RITM. The flow is configured to wait until the change's state is closed or cancelled, and update / close the RITM accordingly. However, I get a confusing error in the Wait for Condition step.
Here is the Wait for Condition part of the flow, along with the error details:

ILYASTEIN_0-1768505068402.png

Will appreciate any advice on how to avoid / handle this error.

1 ACCEPTED SOLUTION

Thank you for sharing the screenshot — that helps clarify what’s happening.

From what’s shown, the reason this isnt working is that the value being stored is the Change Number CHG…, not the sys_id. The Wait for Condition and Look Up Record steps expect a real record reference, and if you pass the display value instead of the sys_id, the record’s attributes wont be available to the flow.

What I’d suggest is:

  • Update the variable to store Change Request → Sys ID from the create step (not the CHG number)

  • Use that sys_id in the Look Up Record step (table: change_request, condition: sys_id = <stored sys_id>)

  • Use the output of that lookup as the record for the Wait for Condition

If for some reason you can only capture the CHG number, then adjust the lookup to query by number instead of sys_id.

Also, i see it’s worth ensuring the lookup and wait steps are running as System, so ACLs don’t prevent the flow from reading the change record.

With those adjustments, the attributes should resolve correctly and the Wait for Condition should behave as expected. Hope this resolves!

@ILYA STEIN - Please mark as Accepted Solution and Thumbs Up if you find Helpful :

View solution in original post

9 REPLIES 9

  • Capture the Change Number (CHG…) from the create step

  • Do a Look Up Record on change_request using number = CHG…

  • Use the lookup result (which includes the sys_id) for your Wait for Condition

Also make sure the create and lookup steps run as System. That's my last thought.

 

@ILYA STEIN - Please mark as Accepted Solution and Thumbs Up if you find Helpful 

Finally figured it out. @Matthew_13 - it worked *almost* the way you described, except that I had to drop the entire change request record into the Change ID flow variable's data pill (which is a string). And then in the Look Up change request record I use Sys ID comparison with the Change ID. I must say that dropping the record data pill into the string flow variable was a little counterintuitive, but as long as it works, I am ok.
Thanks for your help, accepting your initially suggested solution.

Ankur Bawiskar
Tera Patron

@ILYA STEIN 

So your flow is on catalog item, it creates CHG and it should wait till CHG is Closes/Cancelled and then proceed

You can use this approach.

sharing example on how to wait till all catalog tasks are closed and then update RITM, you can enhance it between CHG and RITM

  1. Use "Look up Record" action for change_request table to find all records that matches this RITM (Since CHG is linked with RITM)
  2. Use action "For Each item in" above results
  3. Use action "Wait for condition" where State is Closed/Cancelled.

AnkurBawiskar_0-1768533579363.png

 

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

@ILYA STEIN 

my above approach will work if you are populating RITM on parent field of CHG

That helps you to identify which CHG flow has to wait

💡 If my response helped, please mark it as correct and close the thread 🔒— this helps future readers find the solution faster! 🙏

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

Thanks Ankur, this makes sense. Unfortunately, in my case this didn't work, so I had to create a flow variable to reference the created change request.