Breaking & Routing Condition for blank field

We use APR Breaking and routing to e-mail invoices. We’ve introduced a new custom field on the customer to change the routing. The field is InvoiceEmail_c and there are 3 values available - blank, “Disabled”, and “In-House Destination”. I encountered an unexpected problem when I tried to add a condition with a rule to detect the blank value. My first attempt was:

However, the condition evaluated to false when the field was blank. Knowing that null and blank aren’t exactly the same thing, I also tested variations of equal to “” as well as equal to ‘’. In each case, the condition evaluated to false.
I finally overcame the issue by conditioning on the field not being equal to the other 2 possible values.

While this works, it would be a pain to implement if there were many more possible values. Has anyone else encountered this? Did you find a syntax to successfully test for the blank value?

As a general rule, I’ve found it’s usually more reliable to test for “not equal” than to test for “equal” when dealing with nulls and blanks. You might try reworking the condition code for that.

1 Like

Hi @danvoss ,

My experience in SQL has taught me not to simply rely on conditionals at decision making moment. What I am trying to say is that I’d rather separate evaluation and decision. Something like this:

step 1: result = case when column is NULL then 1 else 0 end
step 2: if result==1 then A else B

I would use Set BPM Field to store the evaluation and then pass it to conditional.
Also this way you can setup some MessageBox notifications (re-use the BPM fields) for testing.