Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Custom ID field with date formatted as YYYY-MM-DD needs to be formatted as DD-MM-YYYY

(0) ShareShare
ReportReport
Posted on by 1,597 Super User 2024 Season 1

Hello,


I have a custom field named "Contract Ref" which is made up of the following format:

[TEXT]-[COLUMN]-[COLUMN]

Where the first Column is "Contract Start Date" and the second column is "ID".

 

The "Contract Start Date" is formatted correctly in SharePoint as 09/06/2020 however when my flow runs, it is formatting the "Contract Start Date" as 2020-09-06. This needs to be formatted as 09-06-2020 so that the Contract Ref column reads as LWCM-09-09-2020-5

 

list.png

 

Register.png

  • sudosaurus Profile Picture
    1,597 Super User 2024 Season 1 on at
    Re: Custom ID field with date formatted as YYYY-MM-DD needs to be formatted as DD-MM-YYYY

    Thank you for your help! 🙂

  • Verified answer
    abm abm Profile Picture
    32,492 Most Valuable Professional on at
    Re: Custom ID field with date formatted as YYYY-MM-DD needs to be formatted as DD-MM-YYYY

    Hi @sudosaurus 

     

    A small correction in @ManishJain  suggestion. The format you need to use is dd-MM-yyyy. It's case sensitive.

     

    Remove the Contract Start Date mapping then place cursor between the hyphen's.  Click the Expression tab on your right (next to Dynamic content). Start typing formatDateTime(,'dd-MM-yyyy'). Then place the cursor before the comma then click the dynamic content and map the value. 

     

    image.png

     

    Finally you will have the exprssion as formatDateTime(''yoursharepointschemnamecontactstart','dd'MM-yyyy'). Click Ok. This should place the format expression under the Contract Ref between LWCM- and -ID

     

    Thanks

     

  • MJain Profile Picture
    2,450 on at
    Re: Custom ID field with date formatted as YYYY-MM-DD needs to be formatted as DD-MM-YYYY

    Hi @sudosaurus ,

     

    Please ensure that cursor is at the right location. When you click ok and if you get that it could be that it is not finding where to insert the expression.

     

    Thanks

  • sudosaurus Profile Picture
    1,597 Super User 2024 Season 1 on at
    Re: Custom ID field with date formatted as YYYY-MM-DD needs to be formatted as DD-MM-YYYY

    When I try this, it says "The Expression is Invalid".

     

    formatDateTime(Contract Start Date,'DD-MMM-YYYY')

  • MJain Profile Picture
    2,450 on at
    Re: Custom ID field with date formatted as YYYY-MM-DD needs to be formatted as DD-MM-YYYY

    When you are adding the field Contract Ref LWCM -  . After LWCM - use expression in place of actual field.

     

    Thanks

  • sudosaurus Profile Picture
    1,597 Super User 2024 Season 1 on at
    Re: Custom ID field with date formatted as YYYY-MM-DD needs to be formatted as DD-MM-YYYY

    In which part of my flow do I insert that?

  • MJain Profile Picture
    2,450 on at
    Re: Custom ID field with date formatted as YYYY-MM-DD needs to be formatted as DD-MM-YYYY

    Hi @sudosaurus ,

     

    If the Contract start date is of type date then you can use formatDatetime and format it.

    eg. formatDateTime(ContractDate,'DD-MMM-YYYY')

     

    Thanks

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