Forum Discussion
Reminder emails - Flow fails when date value is empty
Hi there,
I hope you can help. I have a flow which sends emails 4 days before a target date as reminders. The datasource is a SharePoint Online list.
The emails are sending correctly for list items which meet the criteria (eg 4 days before the date field value), however the Flow is failing. This is for items on the SharePoint list where there are blank values for TargetCompletionDate. Failing on the 'Apply to each' step.
The Condition is using the 'addDays' function to check against the 'TargetCompletionDate' value (see screenshot Reminder flow 3.png).
On the SharePoint list, TargetCompletionDate is a Date and Time column showing date only in a standard format.
The error I see is below.
DogAndPonyShow in your Get items action add a filter query of TargetCompletionDate ne '{null}' where {null} is an expression from the Expression tab in the dynamic content box. ne stands for not equal to. Make sure you include the single quotes around the expression. With this filter it will only bring back items from the list where the TargetCompletionDate actually has something in it so should avoid the error.
Rob
Los Gallardos
Microsoft Power Automate Community Super User
- RobElliottSilver Contributor
DogAndPonyShow in your Get items action add a filter query of TargetCompletionDate ne '{null}' where {null} is an expression from the Expression tab in the dynamic content box. ne stands for not equal to. Make sure you include the single quotes around the expression. With this filter it will only bring back items from the list where the TargetCompletionDate actually has something in it so should avoid the error.
Rob
Los Gallardos
Microsoft Power Automate Community Super User- DogAndPonyShowCopper Contributor
RobElliott- thank you so much! That's worked a treat.
If I add a filtered expression 'TargetCompletionDate ne null' - the workflow no longer errors. Amazing.
Side question: under Dynamic content I don't see any of the SharePoint list columns (screenshot attached) - why would this be? Thanks.
- RobElliottSilver Contributor
DogAndPonyShow don't know, I'd have to see what your flow actions before it are.
Rob
Los Gallardos
Microsoft Power Automate Community Super User