Skip to main content
Community site session details

Community site session details

Session Id : tXXpVDkkAXu31bpz7z/VEf
Power Automate - Using Flows
Answered

Formatting the date / time on a Dynamic content

Like (0) ShareShare
ReportReport
Posted on 23 Feb 2023 09:18:36 by

Hi,

 

I am trying to create a flow that generates Word docs from an Excel table. The flow works fine but I have a problem with the date/time format.

 

In the 'List rows present in a table step' I have selected ISO 8601 for the DateTime Format.

 

Then for the next step, which is Populate a Microsoft Word template, I have selected the appropriate excel columns for the Word fields.

 

Screenshot 2023-02-23 at 5.12.05 PM.png

 

 

However, the output from the generated Word document looks like this:

 

Screenshot 2023-02-23 at 5.14.03 PM.png

In the original Excel Entry, the top row is just date value, i.e. 3/1/2023.

The second row original value is 10:00 and last row is 15:00 (I need the 24 hour time format).

 

How can I format the date to look like this in the Word document?:

 

3/1/2023

10:00 GMT

15:00 Local

 

Appreciate any help on this as I am quite new to Power Automate!

 

  • Verified answer
    Community Power Platform Member Profile Picture
    on 02 Mar 2023 at 04:47:29
    Re: Formatting the date / time on a Dynamic content

    I managed to solved the problem.

     

    Instead of using 'Compose' function, I decided to use the formatDateTime expression in the 'Populate a Microsoft Word template' field where I need the dates and time converted.

     

    Screenshot 2023-03-02 at 12.36.10 PM.png

    I got the expression from the 'Format data by examples' feature.

     

    Local time derived from 'LT' column in my Excel sheet:

    formatDateTime(parseDateTime(items('Apply_to_each')?['LT']), 'HH:mm', 'en-US')

     

    GMT time derived from 'GMT' column in my Excel sheet:

    formatDateTime(parseDateTime(items('Apply_to_each')?['GMT']), 'HH:mm', 'en-US')

     

    As for the date, I used the value from 'Kickoff GMT' column that originally looks like ' 1/3/2023 10:00'. So this expression essentially removes '10:00' and converts 1/3/2023 to 'Wednesday, March 1 2023'

    concat(formatDateTime(parseDateTime(items('Apply_to_each')?['KickOff GMT']), 'dddd', 'en-US'), ', ', formatDateTime(parseDateTime(items('Apply_to_each')?['KickOff GMT']), 'MMMM d yyyy', 'en-US'))

     

    The final output on my Word document looks like this:

     

    Screenshot 2023-03-02 at 12.41.57 PM.png

     

    Hope this is helpful to anyone else facing similar issue as I did.

     

    I appreciate your help @v-bofeng-msft !

  • Community Power Platform Member Profile Picture
    on 02 Mar 2023 at 03:33:43
    Re: Formatting the date / time on a Dynamic content

    Thanks for your suggestion,

     

    I have tried your solution but it seems there is an error:

     

    Screenshot 2023-03-02 at 11.31.38 AM.png

     

    Is it correct to put the 'Compose' function between the 'Populate a Word Document' and 'Create File'?

     

    Thanks again!

  • v-bofeng-msft Profile Picture
    on 24 Feb 2023 at 02:37:36
    Re: Formatting the date / time on a Dynamic content

    Hi @Anonymous ,

     

    Please try:

     

    concat(
     formatDateTime(items('Apply_to_each')['DateTimeColumn'],'dd/MM/yyyy'),
     decodeUriComponent('%0A'),
     formatDateTime(items('Apply_to_each')['DateTimeColumn'],'HH:mm'),
     ' GMT',
     decodeUriComponent('%0A'),
     formatDateTime(addHours(items('Apply_to_each')['DateTimeColumn'],5),'HH:mm'), 
     ' Local'
    )

     

    vbofengmsft_0-1677206234030.png

     

    Best Regards,

    Bof

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

Announcing our 2025 Season 2 Super Users!

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

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!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Featured topics

Restore a deleted flow
Loading complete