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:
...and in Sharepoint:
It's the Word template that is not updating correctly:
Here is a screenshot of that part of my flow...
Get Converted Time Zone Exp:
...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!
@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.
@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?
@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
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:
Set the date format directly in your Word template by specifying the desired format.
-OR-
Create a Text field in SharePoint that stores the date in the desired formatted version