How can I test a numeric ui-only field for null in a formula for another ui-only field

  • 1
  • Question
  • Updated 4 years ago
I am finding UI-Only fields to be very powerful. I now have a situation where I want to test one UI-Only field for null in the formula for another UI-Only field. The field being tested is numeric, it is displayed for input in a field editor, but it acts like it has a value of 0 before the user even makes an entry.
I have tried IF({{MyQty}}==null..., IF({{MyQty}}=={{Blank}}..., and simply IF({{MyQty}}... None of these are able to distinguish between an empty field and an input of zero (0).
Photo of Mike Dwyer

Mike Dwyer, Champion

  • 4,736 Points 4k badge 2x thumb

Posted 4 years ago

  • 1
Photo of Bill McCullough

Bill McCullough, Champion

  • 13,702 Points 10k badge 2x thumb

I was able to replicate what you were seeing. It appears that the numeric UI only field has a value of '0' when 'pulled into' another formula field (even though the field itself shows a null value). I was able to see this by creating a second UI only formula field and just passing in the value from the first 'numeric' UI only field. You can also see this if you look in the console.

I am guessing that Skuid is doing this so that the formula field can 'run' with the number going in.

Do you need to use a numeric field? How about creating a Text UI Only field and prompting your user to enter a number? Then you can test for '0' or 'null' and then convert it to a 'number' for any calculations that you need to do.