Flow Action: Wait for condition where checkbox variable is checked

kchorny
Tera Guru

I need my flow to trigger a catalog task when a checkbox variable, port_assignments_complete, changes from false to true. I've created a business rule that runs whenever a specific task is updated and, if all rows in a MRVS meet specific conditions, this variable is set to true. This part works as expected.

However, I need my flow to wait until that variable is true, then continue on. I know I need to script the conditions in my 'Wait for condition' action because variables are not available to select from, but I can't figure out what my script should look like. 

I tried a script containing this single line, but it doesn't work - the flow continues on as if the condition has been met when it has not:
fd_data.trigger.request_item.variables.port_assignments_complete == 'true';  

I would appreciate any assistance with this.

 
1 ACCEPTED SOLUTION

Marcin20
Mega Guru

Hi,

I propose following approaches:

1) set a field value instead of a variable value, so that this field can be used in 'Wait for conditions' OR

2) create a Flow Variable assigning the above script and checking this Flow Variable value, this may require additional loop with 'Wait for a duration of time' flow logic.

 

Best Regards,

Marcin 

 

If my answer helped you in any way, please mark this answer as helpful and correct.

View solution in original post

6 REPLIES 6

Marcin20
Mega Guru

Hi,

I propose following approaches:

1) set a field value instead of a variable value, so that this field can be used in 'Wait for conditions' OR

2) create a Flow Variable assigning the above script and checking this Flow Variable value, this may require additional loop with 'Wait for a duration of time' flow logic.

 

Best Regards,

Marcin 

 

If my answer helped you in any way, please mark this answer as helpful and correct.

#1 is what I ended up doing. There is a field 'user_input' OOB, and I'm just writing 'Ready' to that field when the variables are completed. Then I set up my 'wait for condition' to look for that to happen.

We don't use that field currently, so the only problem I can think of is that there could be an issue if we start using it in the future. 

Rick62
Tera Expert

kchorny,

It sounds like you already have the process up to checking the box automated?  Instead of having your Flow wait for a condition or a do while loop you could trigger a Flow or Business Rule off that checkbox but variables are harder to deal with.  Try creating a Subflow for the steps after your condition is met...then take the automatically generated code snippet and run it in your after update BR that sets the variable to true.

 

Rick

OlaN
Giga Sage
Giga Sage

Hi,

The "Wait for condition" action in Flow designer is not designed to be used like that.

It's required that you choose a record to make some evaluation on.

Instead you could use looping function do the following until, and there have a condition that checks if the variable is set to true, and within the loop wait for some amount of time.

Example as follows:

find_real_file.png