web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Got error for empty da...
Power Automate
Answered

Got error for empty date field and format date at the same time.

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

What I am trying to do is there is a date field that is not mandatory and therefore sometimes it can be blank. However, if I put 2 expressions in like below I will get an error. Please help advise what i did wrong. 

 

ppp_l_0-1632020091596.png

 

ppp_l_1-1632020151210.pngppp_l_2-1632020176130.png

This was  my expression. 

 

if(empty(outputs('Get_response_details')?['body/r2f6ed29f6e16484c8c527e714dcfdd4e'],null),'',formatDateTime(outputs('Get_response_details')?['body/rfd4e3f0d089e4c74961e10b0e3b1ad60'],'g'))
 
ppp_l_1-1632019503756.png

The planned date 1 and New date 1 can be blank. while the planned date and new date are required fields. 

Categories:
  • Verified answer
    Hardesh15 Profile Picture
    7,087 Super User 2024 Season 1 on at

    @ppp_l  Please make sure that your Date format is in ISO format. And your expression is wrong to check null date.

     

    Correct expression-

    if(empty(outputs('Get_response_details')?['body/r2f6ed29f6e16484c8c527e714dcfdd4e']),null,formatDateTime(outputs('Get_response_details')?['body/rfd4e3f0d089e4c74961e10b0e3b1ad60'],'g'))

     

    It is better to use compose action and see what kind of date format coming in your flow. Based on this outcome you can manage date format.

     

    Please 'Thumbs Up' the posts that helped you and 'Mark as Solution' if my post answered your question.

    @Hardesh /Gopenly.in

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    thank you very much. let me try to do compose first. @Hardesh15 

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 315 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 267

#3
Henil Profile Picture

Henil 115

Last 30 days Overall leaderboard