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 / FormatDateTime with fi...
Power Automate
Answered

FormatDateTime with field from Dynamics CRM not working

(0) ShareShare
ReportReport
Posted on by 27

Hi éveryone,

 

I am trying to format a date field from Dynamics CRM with the help of FormatDateTime but I always get the following error:

 

Unable to process template language expressions in action 'List_records' inputs at line '1' and column '15922': 'In function 'formatDateTime', the value provided for date time string 'birthdate' was not valid. The datetime string must match ISO 8601 format.'.

 

The name of the field is "birthdate" and this is how I am formatting it: formatDateTime('birthdate','MM/dd')

 

I am using it to list records from CRM and made an oData query:

 

((Microsoft.Dynamics.CRM.On(PropertyName='@{formatDateTime('birthdate','MM/dd')}',PropertyValue='@{formatDateTime(utcNow(),'MM/dd')}') or (Microsoft.Dynamics.CRM.On(PropertyName='birthdate',PropertyValue='2020-02-29') and Microsoft.Dynamics.CRM.On(PropertyName='birthdate',PropertyValue='2021-03-01'))))

 

 
 

 

 

Categories:
I have the same question (0)
  • Rahber Profile Picture
    1,935 on at

    can you please show the value of birthdate column?

    How are you getting the value of birthdate?

    Can you please show your complete flow with expanded mode so we can guide you better?

     

    Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.

    Thanks,
    Rahber

     

     

     

  • Thomas Fialek Profile Picture
    27 on at

    Hi Rahber,

    can you please show the value of birthdate column?

    Do you mean how the values look like in CRM?

    It looks as follows:

    value in crm.png

    field date only.png

     

    This is the complete flow. I am basically trying to update the age on the birthdays contact.

     

    flow.png

     

     

  • Verified answer
    Rahber Profile Picture
    1,935 on at

    Why are you using this in the query? PropertyName='@{formatDateTime('birthdate','MM/dd')}'. 'birthdate' is not a date format hence you are getting the error. The Property name should be the name of the column without any formatting. You can only format a date time value like you are doing with  PropertyValue='@{formatDateTime(utcNow(),'MM/dd')}'

     

    Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.

    Thanks,
    Rahber

     

     

    also i see in your CRM dates are stored as mm.dd.yyy and you are mathcing using mm/dd ?

  • Thomas Fialek Profile Picture
    27 on at

    I want to format the field "birthdate" to MM/dd and then compare it with utc now MM/dd to update the age on the record in CRM.

     

    How else can I reach this? I need to get rid of the year in the field birthdate to compare it with formatDateTime(utcNow(),'MM/dd') and update the age on the record.

     

    Do you have any ideas?

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 247 Super User 2026 Season 2

#2
11manish Profile Picture

11manish 164 Super User 2026 Season 2

#3
trice602 Profile Picture

trice602 138 Super User 2026 Season 2

Last 30 days Overall leaderboard