Hi,
someone can help me to understand what it's going different on managing a date from email body when I try to store it in a SharePoint list field?
I have to retrive information from an email
between various data to retrive I have also 2 field date ... these fields in some email are present ...

... in some else they aren't

so, I try to manage presence or not of the information with a if condition:
if(equals(first(skip(split(first(split(body('Da_HTML_a_testo_-_corpo-email'),'To:')),'From: '),1)),null),null,replace(first(skip(split(first(split(body('Da_HTML_a_testo_-_corpo-email'),'To:')),'From: '),1)),decodeUriComponent('%0A'),''))
but, when the field isn't present in the email body I obtain an error:
OpenApiOperationParameterTypeConversionFailed
The 'inputs.parameters' of workflow operation 'Crea_elemento_-_landing-page' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'item/DateTo' is required to be of type 'String/date'. The runtime value '""' to be converted doesn't have the expected format 'String/date'.
... and in the execution plan I can see that as result of the expression i obtain an empty string

... so I also try using expression null in a filed and if condition in other


and with the expression null I get the result I expect null value in the field and no error (the error in the screenshot is for the second date field, with if condition)

finally I verify if condition "equals(first(skip(split(first(split(body('Da_HTML_a_testo_-_corpo-email'),'To:')),'From: '),1)),null)" and it's true than I undestand that expression have to return null as the same of expression null without if condition
Any help will be great
Thank you