Skip to main content

Notifications

Power Automate - Building Flows
Suggested answer

Change the date fields format returned for a word template via Parse Json

(0) ShareShare
ReportReport
Posted on by
Hello all, I am a newbie at this so please be gentle ;-) I have no experience at all in Power Automate and just started the learning process on Saturday.
 
I have a number of columns in a Sharepoint List that contain dates in dd/MM/yyyy format. I want to populate a Word document but the dates returned from the "Get Items" action are in YYYY/MM/dd format. How do I ensure they are entered into the word document in dd/MM/yyyy format. The Sharepoint List (Master Staff) contains a mixture of field types and approximately 20 date field types.
 
From my research I believe that after the "Get Items" action, I need to add a "Parse JSON" action that will go though the Sharepoint List, identify the date fields and format the dates to the desired dd/MM/yyyy format. Am I correct in this assumpation?
 
I have used Copilot to generate the code below, but Power Automate will not accept the code. What is wrong with it?
 
// Loop through each list item
Apply to each (Item in List):
    // Loop through each field in the item
    Apply to each (Field in Item):
        // Check if field is a date
        If (Field is Date):
            // Format the date
            Set Field = formatDateTime(Field, 'dd/MM/yyyy')
 
Below is a screenshot of the flow
 

 
Thank you for any help you can provide
 
Cliff
  • Suggested answer
    David_MA Profile Picture
    David_MA 8,950 on at
    Change the date fields format returned for a word template via Parse Json
    You would use the formatDateTime expression, which you can read about at Customize or format date and time values in a flow - Power Automate | Microsoft Learn. Both SharePoint and Power Automate handle dates in the ISO 8601 format, which is yyyy-MM-dd, but using this expression you can format it as needed.

    As for why it is not working in your flow, you'll need to show how you configured the action where it is not working rather than just showing the actions in your flow. Without seeing how you configured it, there is no way to know what you may have done wrong. If you're getting an error message, it is important to include that in the post as well as that will give a clue to the issue.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,475

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,767

Leaderboard