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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / function to check vali...
Power Automate
Unanswered

function to check valid date

(0) ShareShare
ReportReport
Posted on by 82

Need to work with dates my flow works perfectly if i have date value , but if date is empty my if(express,true-part,false-part) fails and go with the error "Unable to process template language expressions in action 'Compose' inputs at line '1' and column '2321': 'In function 'formatDateTime', the value provided for date time string '' was not valid. The datetime string must match ISO 8601 format.'."

 

it works fine if i add Condition.issue date.jpg

Categories:
I have the same question (0)
  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @gunjan,

     

    Have your solved your problem?

     

    I agree with your thought almost, the formatDateTime() function requires its first parameter to be a datetime string which match ISO 8601 format, if you provided a empty value for the first parameter, the formatDateTime() function would fail.

     

    More details about the formatDateTime() function, please check the following article:

    formatDateTime() function

     

    You could consider take a try to add a Condition to check if the date value is empty, if yes, do nothing, if no, convert the date value using the formatDateTime() function:9.JPG

     

    If your problem is solved, please click "Accept as Solution" so that this thread will be marked for other users to easily identify if your problem is solved.

     

     

    Best regards,

    Kris

  • Community Power Platform Member Profile Picture
    on at

    If the datetime value format is not true, function formatDateTime() will be failed. How to resolve ?

  • SaiRaj3 Profile Picture
    6 on at

    You can do Exception error handling in Power Automate flow by using Scope Control and Configuring run after properly,

    In Try Block of the Scope Control add that compose statement and in catch block configure it to run only when try is failed with a compose result('try') which has the Error JSON and add a Finally Block where you can check the length of that JSON identify if the Try has failed or not.

    SaiRaj3_0-1693570740778.png

    Best Regards,
    Sai Raj

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard