Trigger server action when database field is empty

Hello,

I’m a little stuck and the research on the forums I’ve done haven’t helped. I have two database fields, one is a toggle (1/0) and the other contains a date. I have a server-side flow that updates the toggle field fine, and I want to set up an update action on the field that contains the date only if said field is empty. If the field is not null, then I don’t want it changed.


My condition is not working, I’ve tried with null, ‘null’, etc…, unsuccessfully.
Any advice?
Thanks!

Try putting it in the condition column of the Database Update instead.

Thanks @sitestreet - yes, I’ve tried that too, but I hit the same issue where I don’t know how to signify the field as null/empty:

Sorry, thought I was onto something but I don’t think my suggestions are what you need.

did you try null with out the single quotes? and or might need to just be NULL, and in all reality if you just leave it blank? sometimes I tend to overthing things?

Condition {{ha_start_check.eq_ha}}

if empty it will just assume its empty.

I know sometimes it tricky to get the check for null to be right, but I think if yo have ‘’ it thinks its a string.

Yes, it’s currently a string. I’ve tried single and double quotes, and just null, too, without luck.

Try
{{ !ha_start_check.eq_ha }}
or
{{ ha_start_check.eq_ha.length == 0 }}
or
{{ !ha_start_check.eq_ha.length }}
or
{{ empty(ha_start_check.eq_ha) }} (if you are using php)

This worked @JohnL . Thanks for putting an end to an annoying and lengthy migraine! I have multiple scenarios like this in my project, you've helped take a massive weight off my shoulders.

2 Likes