Handling Null and Blank Date Fields in Power Automate
Checking whether a date field is blank in Power Automate has always been trickier than it should be. The value might be null, an empty string, or the infamous 0001-01-01T00:00:00Z. Here is how to handle all of these reliably.
The Problem
When you pull a date field from Dataverse, SharePoint, or a SQL connector, an empty date can appear in multiple forms depending on the source:
- Dataverse: returns
null - SharePoint: returns an empty string
"" - SQL Server: may return
1900-01-01orNULL - Excel: returns an empty string or
0
A simple equals null condition often misses these edge cases.
The Reliable Approach
Use the empty() function combined with coalesce():
@empty(coalesce(triggerOutputs()?['body/dateField'], ''))
This handles both null and empty string in a single expression. If the field is null, coalesce falls back to an empty string, and empty() returns true.
Checking for the Epoch Date
Some connectors return 0001-01-01T00:00:00Z instead of null. Add a secondary check:
@or(
empty(coalesce(triggerOutputs()?['body/dateField'], '')),
equals(formatDateTime(triggerOutputs()?['body/dateField'], 'yyyy'), '0001')
)
A Cleaner Pattern with Compose
For readability, break it into steps:
-
Compose — name it
DateValue:@coalesce(triggerOutputs()?['body/dateField'], '') -
Condition — check if blank:
@or(empty(outputs('DateValue')), equals(outputs('DateValue'), '0001-01-01T00:00:00Z'))
This makes the flow easier to debug and the logic visible at a glance.
Dataverse-Specific: Use the Null Check Directly
With the latest Dataverse connector, you can use the condition action and compare directly to null — it now handles this correctly for Dataverse date fields. Select the field, operator is equal to, and leave the value blank.
This works reliably as of 2026, though I still prefer the explicit expression approach for portability across connectors.
Key Takeaway
Never trust a single null check for dates across different connectors. The empty(coalesce(...)) pattern is defensive, portable, and takes 30 seconds to implement. Use it everywhere.
Keep reading
Retry Policies in Power Automate: What Actually Happens When an Action Fails
How Power Automate retry policies work, which errors they cover, how to configure them, and how to keep retries from duplicating side effects.
Resilient Power Automate: Retry Policies and Dead-Letter Patterns
Transient failures are normal in any flow that calls an API. The difference between a flow that self-heals and one that pages you at 2 a.m. is how you handle retries and the failures that stick.
15 Power Automate Expressions Every Maker Should Memorize
Memorize these Power Automate expressions to build faster flows, handle nulls, shape arrays, format dates, reduce action count, and debug WDL.
Newsletter
New posts, straight to your inbox
One email per post. No spam, no tracking pixels, unsubscribe anytime.
Comments
- No comments yet. Be the first.