Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
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'))))

 

 
 

 

 

  • Thomas Fialek Profile Picture
    27 on at
    Re: FormatDateTime with field from Dynamics CRM not working

    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?

  • Verified answer
    Rahber Profile Picture
    1,935 on at
    Re: FormatDateTime with field from Dynamics CRM not working

    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
    Re: FormatDateTime with field from Dynamics CRM not working

    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

     

     

  • Rahber Profile Picture
    1,935 on at
    Re: FormatDateTime with field from Dynamics CRM not working

    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

     

     

     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May 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 >