flow designer if statement returning false when condition is actually true....

Kai Tingey
Tera Guru

Hi Team

 

I have a frustrating issue here. I am working on a flow to check manager financial delegation and iterate through user records until doa is sufficient. 

 

I've set it up so that it

- looks up requested for user's manager

- adds the manager record to a reference flow variable

- adds the manager's DOA to a string flow variable with the (convert string to number) transform applied

- adds request price to string flow variable with (convert string to number) transform

- marks checkbox flow variable true / false if doa is sufficient using this script:

if (fd_data.flow_var.manager_doa > fd_data.flow_var.price){    return true;}

 

then it checks if the value is false - and if so, runs a 'do the following' loop to iterate up through the managers of each record (populating the variables above) until the checkbox becomes  true. In real life this should usually be one to two hops max.

 

the first part works and the flow variables are being populated as expected, however in testing i am now getting the following when it hits the 'if' statement :

KaiTingey_0-1709086023436.png

 

 

 

 

run time value = false, condition it is looking for is 'false' - that should be evaluating to 'true' no?

 

just out of curiousity, i thought i'd reverse the if statement and see what happened (so if flow variable = true then do the following). Same thing, evaluated false - but it's doing this:

KaiTingey_0-1709086154125.png

 

 

 

i tried deleting the whole block from the flow and recreating it more than once and it is still doing this, what am i doing wrong here? may be something really silly and obvious but i'm not seeing it.

 

 

I have also tried putting the if statement inside the 'do the following' but then it just loops forever until it times out, constantly returning false.

 

KaiTingey_3-1709085593410.png

 

 

1 ACCEPTED SOLUTION

James Chun
Kilo Patron

Hi @Kai Tingey,

 

Can you try adding the following script in the 'Set Flow Variables' action?

else{
return false;
}

Or an alternative is to set the 'doa>price' to false at the beginning of the flow via 'Set Flow Variables'.

 

Cheers

View solution in original post

2 REPLIES 2

James Chun
Kilo Patron

Hi @Kai Tingey,

 

Can you try adding the following script in the 'Set Flow Variables' action?

else{
return false;
}

Or an alternative is to set the 'doa>price' to false at the beginning of the flow via 'Set Flow Variables'.

 

Cheers

yep that got it, didn't even think to try that - i was caught up on default value of it being false 

 

legend, thanks mate.