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 / SQL GetRows v2 convert...
Power Automate
Unanswered

SQL GetRows v2 converts String to DateTime on data retrieval

(0) ShareShare
ReportReport
Posted on by 2

I'm pulling data from an SQL View which outputs a date as a string, i.e. just the date, no time, in format yyyy-MM-dd.  When it is collected by Power Automate using the GetRows connector it converts the string into a datetime format by appending T00:00:00Z to the end of the string.

 
For example I am expecting to retrieve 2023-09-25 but I actually receive 2023-09-25T00:00:00Z despite it being a string format output from SQL
 
Is there a way to prevent this please?
Categories:
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @LeeChatfield ,

     

    Please try to use formatDatetime function.

    formatDatetime('2023-09-25T00:00:00Z','yyyy-MM-dd')

    https://learn.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#formatdatetime

     

    Best Regards,

    Wearsky

  • LeeChatfield Profile Picture
    2 on at

    Thanks @v-xiaochen-msft 

     

    I'm hoping to find a way where I don't have to transform the data within Power Automate.  The flow I'm using, shown below, simply gets the results of a query then dumps it straight into a csv file to send as an email attachment.  I never actually interract with the output of the SQL query other than to dump it in a csv.  Any thoughts on if there's a way to do this without looping through each line returned from the SQL query?

     

    LeeChatfield_0-1716969417482.png

     

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
11manish Profile Picture

11manish 315 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 267

#3
Henil Profile Picture

Henil 115

Last 30 days Overall leaderboard