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 / How to export a date/t...
Power Automate
Answered

How to export a date/time field from SQL table such as "2020-08-03T00:00:00Z"  to 8/3/2020 on a Google Sheet?

(0) ShareShare
ReportReport
Posted on by 152

I want to export a Date Field from a SQL data table to Google Sheet as Month/Day/Year.

 

The problem I have is the the Date Field is exported as "2020-08-03T00:00:00Z" to a Google Sheet, but I want it to export as "8/3/2020" or at least take out everything after the "T".

 

I can export Closing Date to GoogleSheet, but it will look like "2020-08-03T00:00:00Z". 

Flow-SQL-DateFormat.PNG

 

So, I think I should use "Expression" such as "formatDateTime (ClosingDate, 'm/d/yyyy')" to change its format to m/d/yyyy.

Yet, when I typed in "formatDateTime in Expression, and then switch to "Dynamic content", the only options I have are "List of items" and "value".  All the field names from the SQL table are gone. 

Flow-SQL-DateFormat1.PNG

How do I export a date/time field from SQL table such as "2020-08-03T00:00:00Z"  to 8/3/2020 on a Google Sheet? 

 

Thanks!

 

dchan

 

Categories:
  • Christopher S Profile Picture
    Microsoft Employee on at

    Hi @dchan1 

     

    You can use the "Convert time zone" action form Flow in order to get the format that you wish:

    Annotation 2020-07-20 185206.jpg

    On the format string field, you can select which format you wish.

     

    Best Regards

    --

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions help users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

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

     

    Hi @dchan1 ,

     

    You could fill the corresponding dynamic content in the Compose and use formatDateTime() function to format the output of the Compose.

    13.PNG

    Then you could fill the following expression in the corresponding field.

    formatDateTime(outputs('Compose'),'M/d/yyyy')

    Hope this helps.

     

    Best Regards,

  • Verified answer
    dc7669 Profile Picture
    152 on at

     

    Thanks @v-bacao-msft  @chsanche 's inspirations.  Your methods may work, but this is how I got it at the end. 

     

    I created a Test Variable to hold "ClosingDate" within the "Apply to each" loop for my SQL table.

    Then, I created another variable, Test2, to hold the "correct value", i.e. formatDateTime(Test, 'M/d/yyyy')

    Then, in the "Insert row" step, I put Test2 variable in, instead of the ClosingDate field from SQL table. 

     

    Flow-SQL-DateFormat2.PNG

    Looking back, it looks like a logical and sensible method.  I wonder why I did not think of it before!  

     

    Thanks for your input. 

     

    Dchan

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 355

#2
11manish Profile Picture

11manish 336 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard