How do you trigger a task based off the answer to a variable in a previous task

megw
Tera Contributor

I am new to flow designer and am trying to trigger a task off of the answer to a variable in the previous catalog task. In this case, a requested item is created, a catalog task is created that includes a variable that requires a yes or no answer by the fulfiller. I want to set up an 'if' option that triggers a new task if the variable is answered YES, but closes the request if the answer is NO.

 

I originally had the variable as a drop down box with 'none', but the workflow stalled at the 'if'. I then set the default to 'YES', and now the workflow always follows the YES path. I have set a wait parameter between the closing of the first task and the 'IF' statement, no help. I then added in the action to 'Gather Catalog Variables' since the variable on the RITM updates with the selection made  on the first catalog task, but it is still pulling the original value of YES. 

 

Would appreciate any help - thank you!

1 ACCEPTED SOLUTION

Sebastian L
Mega Sage

Hi megw, 

 

When do you do the "Get Catalog Variables from Test Item"? After the second catalog task? 

I just did a quick test with a flow and saved the variable in a flow variable like this. Make sure you do a second look up of the catalog variables after the completion of the catalog task: 

SebastianL_5-1670352332132.png

 

Original variable was with value "12345678", and I've set the first task to that value. Second task is setting the same variable as short description, but the value is changed to "123" in the first task: 

SebastianL_3-1670351734718.png

Catalog task configuration: 

SebastianL_4-1670351762859.png

 

There are some sync issues with Flow Designer, and if you change the variable and close the task in the same action, I have sometimes seen that it moves on before it can catch the new value. But it should work to do a second look up of the catalog variables AFTER completion of the task, and then use that reference in your if statement! If this does not work for you, try to put a "Wait for a duration of time" to like 5 seconds. But it should not be needed! 

 


Best regards,
Sebastian Laursen

View solution in original post

3 REPLIES 3

Sebastian L
Mega Sage

Hi megw, 

 

When do you do the "Get Catalog Variables from Test Item"? After the second catalog task? 

I just did a quick test with a flow and saved the variable in a flow variable like this. Make sure you do a second look up of the catalog variables after the completion of the catalog task: 

SebastianL_5-1670352332132.png

 

Original variable was with value "12345678", and I've set the first task to that value. Second task is setting the same variable as short description, but the value is changed to "123" in the first task: 

SebastianL_3-1670351734718.png

Catalog task configuration: 

SebastianL_4-1670351762859.png

 

There are some sync issues with Flow Designer, and if you change the variable and close the task in the same action, I have sometimes seen that it moves on before it can catch the new value. But it should work to do a second look up of the catalog variables AFTER completion of the task, and then use that reference in your if statement! If this does not work for you, try to put a "Wait for a duration of time" to like 5 seconds. But it should not be needed! 

 


Best regards,
Sebastian Laursen

megw
Tera Contributor

Hi Sebastian, thanks so much for the reply. I do have the 'Get catalog variables' step set after the 1st catalog task is complete, but I am not familiar with the 'Set Flow Variable' flow logic step - what would I need to set in that step?

megw
Tera Contributor

actually, I figured it out - thank you so much!