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 / Date Formatting from F...
Power Automate
Answered

Date Formatting from Form to Sharepoint List

(0) ShareShare
ReportReport
Posted on by 22

Hi,

 

I have built the below flow to take answers from a form and then populate a sharepoint list, fairly simple but the dates (there are multiple different dates in the form)  from the answers in the form wont format the way I want them too (DD-MM-YYYy). I have checked the local settings in SP and they are all correct but it keeps giving me YYYY-MM-DD. Where am i going wrong ?.

 

 Any help would be great. 

 

 

 

 

 

Screenshot 2024-06-04 102805.png

Categories:
I have the same question (0)
  • v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @Niven ,

    Because the format of the return value of the date of the SharePoint connector is always yyyy-MM-dd, which does not change.

    vyetonggumsft_2-1717494591855.png

    The default display format of dates in SharePoint lists is MM/dd/yyyy.

    vyetonggumsft_3-1717494616031.png

    If you want the date format to be displayed in dd-MM-yyyy in the email body, please try formatDateTime in send an email.

    Like this:

    vyetonggumsft_4-1717494835310.png

    formatDateTime(outputs('Create_item')?['body/Date'],'dd-MM-yyyy')
     

    Best Regards,

    Sunshine Gu

  • Niven Profile Picture
    22 on at

    Hi @v-yetonggu-msft 

     

    Thanks for the response, I don't need any formatting in the email that is just to notify staff that the form has been completed and then they go to the SharePoint list. 

     

    You say "Because the format of the return value of the date of the SharePoint connector is always yyyy-MM-dd, which does not change." But I created a separate SP list on another site and changing the reginal settings changed the formatting of the dates.  I also mirrored the form and flow and it worked ? 

     

    Are you saying there is no way to change the formatting of dates in SP ?  I currently get YYYY-MM-DD. 

     

    Can I also add that my data types in the SP list are single lines of text and not dates as the flow wont work if they are set to dates, I don't know if this could be affecting it.

     

    Thanks

  • v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @Niven ,

    It looks like your expression is written incorrectly, please see this test:
    My MS Form:

    vyetonggumsft_2-1717554189904.png

    My Flow:

    vyetonggumsft_0-1717553976049.png

    formatDateTime(,'dd-MM-yyyy')

    My SharePoint List:

    vyetonggumsft_1-1717554038702.png

    Best Regards,

    Sunshine Gu

  • Niven Profile Picture
    22 on at

    HI @v-yetonggu-msft  

     

    When entering your expression i get an error, Please see below. Thank you.

    Screenshot 2024-06-06 092316.png

  • v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @Niven ,

    Please add your date dynamic content to the expression, I'm just an example.

    vyetonggumsft_1-1717663150346.png

    formatDateTime(DateDynamicContent,'dd-MM-yyyy')

    First Click the Dynamic Content.

    vyetonggumsft_2-1717663205137.png

    Then add the Dynamic Content to formatDateTime(,'dd-MM-yyyy') expression.

    Best Regards,

    Sunshine Gu

     

  • Niven Profile Picture
    22 on at

    Apologies, Thank you for clarifying, I inputted The expressions and added my data. Testing the flow I get the following error. Thank you for your help.

     

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

  • Verified answer
    v-yetonggu-msft Profile Picture
    Microsoft Employee on at

    Hi @Niven ,

    This means that you did not enter any date, so try this expression:

    if(empty(DateDynamicContent),null,formatDateTime(DateDynamicContent,'dd-MM-yyyy'))

    Best Regards,

    Sunshine Gu

  • Niven Profile Picture
    22 on at

    Perfect That worked, Thank you for your help.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 612

#2
Valantis Profile Picture

Valantis 344

#3
11manish Profile Picture

11manish 326

Last 30 days Overall leaderboard