web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

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:
I have the same question (0)
  • v-xiaochen-msft Profile Picture
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard