Hi Team - this is one i should know but i can’t make it work. I have a query returning data from a database. Within that data there are dates. I use formatDate to… well, ya know, format the date. Problem is sometimes the date is empty and it returns an error because you cant format an emptystring.
I have tried functions with if, ifempty and switch. I have used “”, null and emptystring but i can’t get it to work but it continually comes back saying cant format an emptystring.
Looking at the data returned in the history it shows the date as “empty”.
Were you ever able to figure this out? The only thing I can think of is to use an ifempty( ) and push a dummy date when the imported data is blank which is less than desirable.
EDIT: I think I figured it out:
if(date != null; formatdate(date;YYYY-MM-DD);)
If date field is not empty, return the formatted date, otherwise return nothing