cancel
Showing results for 
Search instead for 
Did you mean: 

Condition is false but step is still executed

jashmore
Deputy Chef I
Deputy Chef I

Hi - I need help please on a strange situation...

I have a simple IF condition checks if an integer variable is greater than zero.  When I run the job I can see that integer is in fact zero, and that the condition evaluates to false, but it is still executing the steps within the condition.   

As a test to make sure the steps were truly nested within the condition, I changed the condition to if true equals false, which evaluated to false as expected, and skipped the contained steps, as expected.  

I've also tried not equal to zero > condition is false as expected but the steps are executed.  And just for fun equal to zero > condition is true as expected and steps are executed as expected.  

Has anyone seen this before where it goes into the steps even when the condition fails?  Thanks in advance!

 
 

 

2 ACCEPTED SOLUTIONS

gary1
Executive Chef III
Executive Chef III

I think I need to see more of the recipe to get a better idea of what's happening. Here are some thoughts:

  1. Dupe the recipe and re-run it. This sometimes fixes "illogical" behavior.
  2. Add a logger inside the conditional to capture RowCount. Something funky is happening there. Do you have another RowCount variable somewhere in the recipe?
  3. Try recreating RowCount as a different variable. Maybe a variable schema thing?
  4. If this recipe segment is within a loop, there might be something else happening, but I can't really see.

View solution in original post

mppowe
Executive Chef I
Executive Chef I

The first thing that came to mind to me was a data type issue, like comparing a string against a number.  But your screenshots show the variable is an integer, and the IF condition always says ABC.  But for chuckles, maybe try changing the IF to be formula mode and see if RowCount > 0 as the formula (and the condition just becomes "is true") and see what does?  You can also use some logger steps to evaluate formulas to see how they wind up, like RowCount = 0, RowCount = "0", etc.

View solution in original post

8 REPLIES 8

gary1
Executive Chef III
Executive Chef III

Can you share how the condition is written and maybe a screenshot of the input and output?

The screenshots didn't upload in order unfortunately, but there are 6 screenshots.  3 screenshots defining the RowCount variable, the condition and the RowCount2 variable... and 3 screenshots inspecting RowCount, the condition and RowCount2.  Thanks for taking a look!

gary1
Executive Chef III
Executive Chef III

Is this running within a loop?