I'm trying to build a Power Automate flow that sends a recurring reminder email every 14 days after the Due Date – so on day 14, 28, 42, etc. – as long as the status is still active (for example: "Open", "Reopen", or "Monitor").
This is the expression I'm currently using in my condition:
mod(float(split(dateDifference(formatDateTime(utcNow(),'yyyy-MM-dd'), formatDateTime(item()?['field_17'], 'yyyy-MM-dd')), '.')[0]), 14)
Although the email does get sent, I keep getting the following error in the flow run history: The template language function 'float' was invoked with a parameter that is not valid.
The value cannot be converted to the target type.
How can I safely rewrite this expression so that it:
Sends an email every 14 days after the due date
Doesn't throw errors if the field is empty or badly formatted
Works consistently and reliably?
Thanks in advance for your help!

Best regards,
Nuran