In some cases, I want to allow a null value to be the result of an expression.
This is already an option for special cases as the NULLIF()funktion.
However a common case is something like this:
if(@Variable.status = 'released', @App info.Current Date and Time , {null})
I have 10 record fields to save to and one or two of them are dependent on other values. Then I don’t want to add more and more triggers because I don’t want the redundancy, and maintenance overhead.
The only workaround I found is to use the NULLIF() function with dummy values to create a “date-type-null-value” (NULLIF(1,1) does not work for dates because 1 is not a date)…
if(@Variable.status = 'released', @App info.Current Date and Time , nullif(@Table record.CurrentRecord.Date Created , @Table record.CurrentRecord.Date Created ))
please make null a valid null value as a possible expression result!
Extra special sauce for you @thorsten.langner on the date problem. Shouldn’t be this hard but hopefully this helps others in the future!
nullif(texttodatetime(if(@Variable.Selected SAP Batch v4.Date of Manufacture = '', '1900-01-01', @Variable.Selected SAP Batch v4.Date of Manufacture ), 'YYYY-MM-DD'), texttodatetime('1900-01-01', 'YYYY-MM-DD'))