Skip to main content

Notifications

Power Automate - General Discussion
Answered

Date/Time not populating correctly in Word Template but is populating correctly in PowerAutomate flow?

(0) ShareShare
ReportReport
Posted on by

Hello - 

I have built a flow that carries out the following steps: 

1. Trigger - MS Forms response

2. Populates an MS Word Template with forms responses

3. Updates File Properties in Sharepoint

 

The flow is running, but it is populating the date incorrectly in the MS Word Template.  I want the date to populate in the MS Word Template as MM-dd-yyyy, but it is populating like this example: 

2024-03-02T08:00:00+00:00 (with the time added in an the month, date, and year out of order).  This is confusing to me because it appears to be formatted correctly in the flow outputs: 

jessicadduffey_0-1707776076965.pngjessicadduffey_1-1707776125913.pngjessicadduffey_2-1707776167373.png

jessicadduffey_3-1707776209156.pngjessicadduffey_4-1707776245515.png

...and in Sharepoint:

jessicadduffey_5-1707776292797.png

It's the Word template that is not updating correctly: 

jessicadduffey_6-1707776340297.png

 

Here is a screenshot of that part of my flow...

jessicadduffey_7-1707776442388.png

Get Converted Time Zone Exp: 

formatdatetime(variables('PostDeadline'),'MM-dd-yyyy')
 
jessicadduffey_8-1707776523702.png

...where the posting deadline is the output of the Get Converted Time Zone action.

 

Any ideas on how I can get the date to populate correctly (without the time) in the Word template?

 

Thank you!

Categories:
  • AlexEncodian Profile Picture
    AlexEncodian 4,302 on at
    Re: Date/Time not populating correctly in Word Template but is populating correctly in PowerAutomate flow?

    @jessicadduffey 

    I was suggesting Encodian as an alternative if you run into limitations with the native premium Word connector (or if you need a standard connector). Try @SudeepGhatakNZ 's suggested workarounds for using the Word  Online premium connector. 

  • Re: Date/Time not populating correctly in Word Template but is populating correctly in PowerAutomate flow?

    @AlexEncodian , this is helpful, but I am not using Encodian - I am using the Word Online premium connector Populate an MS Word Template.  The limitation with this method is that you cannot define the Sharepoint column type as date/time or else the field will not show up in PowerAutomate; it needs to be defined as a single line of text or multiple lines of text.  There's no way (that I know of) to autoformat this field in the Word Template so it shows up as m/dd/yyyy format.  Do you have any suggestions outside of the Encodian connector?

  • Verified answer
    AlexEncodian Profile Picture
    AlexEncodian 4,302 on at
    Re: Date/Time not populating correctly in Word Template but is populating correctly in PowerAutomate flow?

    @jessicadduffey 

    There are workarounds to fix this particular issue. Just wanted to flag that Encodian's Populate Word Document action handles custom formatting in the template so its as flexible as you need it to be. It also handles various other use cases (string formatting, conditional expressions, repeating nested arrays, etc) natively with no content controls, just plain text merge tags.

     

    Expression Results and Formatting

    AlexEncodian_0-1707854372928.png

     

  • SudeepGhatakNZ Profile Picture
    SudeepGhatakNZ 14,231 on at
    Re: Date/Time not populating correctly in Word Template but is populating correctly in PowerAutomate flow?

    @jessicadduffey 

     

    SharePoint stores dates in UTC format internally, which means that the same format will appear in your Word template. To address this, you have two options:

    1. Set the date format directly in your Word template by specifying the desired format.

      -OR-

    2. Create a Text field in SharePoint that stores the date in the desired formatted version

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,422

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,711

Leaderboard