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 / Saving SQL query resul...
Power Automate
Answered

Saving SQL query results to csv on sharepoint

(0) ShareShare
ReportReport
Posted on by 76

I am new to MS Flow. I am trying to schedule a flow that will each time save the results of the SQL query to csv or excel, under same name. 

I hoped this would be simple with Flow but it's fairly complicated. If I understood correctly I can't just do this in 3 steps, start->query->Save, I need to do it for each item in the results. Below is my poor attempt , just saves the last item I guess. 

Also, when I resolve this, do I need add a step to delete the file and create new one with the same name of will the flow overwrite the file?

 

7A753EC8.png

 

 

 

Categories:
  • Verified answer
    v-duann-msft Profile Picture
    Microsoft Employee on at

    Hi @Krcmjaster 

     

    Thank you very much for posting.

     

    According to your query, you would like to export data from SQL and export to a CSV file in SharePoint. If that’s the case, we can combine ‘create CSV table ’ with ‘create file’ to achieve your purpose.

     

    The whole flow may look like as below:

    v-duann-msft_0-1612507144605.png

     

     

    You could refer below articles to create CSV table:

    https://flow.microsoft.com/en-us/blog/html-tables-csvs-computer-vision/

    https://us.flow.microsoft.com/en-us/galleries/public/templates/79095f001ee911e79dc3835964ea3218/copy-sharepoint-list-items-into-a-csv-each-week/

     

    Yes, we will encounter duplicate issue if file with same name created. Thus, I recommend we can use a dynamic content [‘utcnow().csv’ something like that] as filename for easily distinguishing which is the updated one.

     

    Hope it helps.

     

    Thanks

    Anna

  • Krcmjaster Profile Picture
    76 on at

    @v-duann-msft Thanks, this helped 

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 424

#2
11manish Profile Picture

11manish 328 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard