new task should get created based on previous task variable.

wefw
Tera Contributor

I'm working with Flow Designer to create tasks in ServiceNow, and I have a scenario where we use a variable with Yes/No options (but we don't display this variable in the catalog item view).

Here's the flow:

  1. A Service Catalog item is triggered, and a task is created.
  2. in that task the variable (Yes/No) is updated by the fulfiller or user after the task is created.
  3. The goal is that when the Yes/No variable is updated with Yes and saved on the sc_task form, a new task should be created.

I tried to set up a condition in Flow Designer that checks for changes in the Yes/No variable after the first task creation. However, the flow is not waiting for this condition to trigger as expected. The flow seems to proceed without checking this condition before the task is closed.

After the task is closed, the condition works as expected, but before closure, it doesn't wait for the Yes/No variable change. Is there a way to get the flow to wait for the condition before the task is closed, so that a new task can be created when the variable is changed?

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

@wefw 

you can use IF logic just after your 1st task is completed.

Remember to use Get Catalog Variables again after 1st task and then determine the variable value

if it's yes then create another task

If no then have other path.

If my response helped please mark it correct and close the thread so that it benefits future readers.

6 more mistakes to avoid when using flow designer

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

I have tried that one, but flow is not waiting at that condition. It going to that step but before user entering the any value it checking and making false and moving on

@wefw 

ensure Wait checkbox is ticked in Create Catalog Task Action

The variable based on which you want to wait is present on the 1st task in variable editor?

AnkurBawiskar_0-1741181172615.png

 

After the task is closed you can use Get Catalog Variables Flow action and then use IF logic

AnkurBawiskar_1-1741181296270.png

 

If my response helped please mark it correct and close the thread so that it benefits future readers.

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

but here the case is before closing the first task, if user set the variable as Yes and save the task, then second task should get created. 
For Example: 1st task is created. User set the variable as yes in first task and saved the task form, (task will be in work in progress state or any state other than close complete) then second task should get created