Skip to main content
Community site session details

Community site session details

Session Id : 7oNLtPksRL0G2MLgvdLut7
Power Automate - Building Flows
Answered

Why do workflows fail when a date field contains no data?

Like (0) ShareShare
ReportReport
Posted on 20 Mar 2023 02:30:21 by 33

Hi everyone

 

I am working on a flow that sends an HTML table by email on a weekly basis, containing a summary of data from a SharePoint list. This list contains three different date fields. I'll also preface this with a note to say I am self-taught when it comes to Power Automate, so I may have some fundamental knowledge gaps that might be obvious to others. 

 

The first issue I had with the dates involved getting the dates to reflect the appropriate date format (I need dd/MM/yyyy). I had to use two different approaches to achieve this. For the first, I successfully used the formatDateTime() expression - but this would not work for the other two date fields for some reason I can't identify. For the other two, I used the following actions to change the date format (it achieves what I need perfectly). 

eellis1_0-1679278635296.png

 

HOWEVER, now I have an issue where my flow will fail if any of the date fields in my list are blank. I have ensured that all date fields in the List are not set as required fields. I have tried to use the following expression: 

if(equals(outputs('Dynamic field for set variable'),null),'',outputs('Dynamic field for set variable'))

...but of course, it doesn't like that. And if I use the List's corresponding date fields, the date is in the wrong format. 

 

Any suggestions for getting around this issue? If anyone could explain why workflows fail when a date field is left blank too, despite the field not being a 'required field' I would really appreciate the insight for my own understanding too.

 

Many thanks 

  • Verified answer
    eellis1 Profile Picture
    33 on 27 Mar 2023 at 03:49:56
    Re: Why do workflows fail when a date field contains no data?

    I solved this one on my own using the following expression in the relevant Select action field, removing the need for Variable and Convert Time Zone actions:

     

    if(empty(item()?['FieldName']), '', formatDateTime(item()?['FieldName'], 'dd/MM/yyyy'))
  • v-chengfen-msft Profile Picture
    on 20 Mar 2023 at 02:55:53
    Re: Why do workflows fail when a date field contains no data?

    Hi @eellis1 ,

    Please try:

    if(equals(outputs('Dynamic field for set variable'),null),null,outputs('Dynamic field for set variable'))

     

     

    Best Regards

    Cheng Feng

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1