Hi
So in a normal If statement you have if(statement, true, false);
But YOU do not want to do this, because you are returning a NULL which is not valid.
Instead you want your expression to be this
If(statement, true or false); and done
So we need to re-write your stuff
if(not(empty(triggerOutputs()?['body/Datethecomplaintwasreferred'])), triggerOutputs()?['body/Datethecomplaintwasreferred'])
This way it ONLY tries to write data is its NOT empty, otherwise it passing NOTHIHNG.. not NULL, but nothing, so it ignores the column.
As this should solve your problem if you can mark as the answer please.