I am trying to create a form where I need to run a pgsql procedure based on some values via a form and some values can be optional as well so I want to send NULL for those values but it shows error that says invalid integer value “”"" something like that, I tried to convert textbox type to number as well but no success
I need to do something like similar to case statement in query in retool
CASE WHEN {{txtZIP.value}} IS NOT NULL THEN {{txtZIP.value}} ELSE NULL END
I am unable to find anything like this in retool any idea will be appriciated.
Hey @wmg91 welcome to the Retool forum! Thanks for posting.
I think I follow what you’re asking, but if I’m off please share some more details or a screenshot of your issue.
You should be able to do this all inside {{ }} with some quick JS. Something like this might work:
CASE WHEN {{ txtZIP.value == "" }} THEN {{ txtZIP.value }} ELSE NULL END
Everything inside {{ }} is JS so when txtZIP.value is the empty string "" then {{ txtZIP.value == "" }} will evaluate to true and your first case will return. LMK if that works!