I have some columns that I set in my model as JSONNumber. I don’t want them to default to zero but to null. I get this behavior when I change them to JSONString, but I have set up calculations such as prices with them. Will going to JSONString break the calcs? The columns I want to change are the quantities, not the prices. The problem I am having is the users are blowing by the fields.
Using JSONString will likely break summary calcs.
//using JSONNumber 3 + null // 3 3 + 0 // 3 //using JSONString "3" + null // "3null"
If you’re trying to validate that a number field is not left blank (or “0”) could you just use a custom validator for that? Or if it’s a standard number field in BetterForms, you can set a minimum value
Blank to start is the goal. Correct answers include 0. Maybe I should have built it differently. I’ll experiment. Thank you.
If that’s the case, perhaps you can simply edit your asJSON field in FM to dynamically change the type…
JSONSetElement ( ... [ "quantity" ; quantity ; If ( IsEmpty ( quantity ) ; JSONNull ; JSONNumber ) ] ...
Thanks, this looks like it will work. I’ll give it a try.