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

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Saving SQL query resul...
Power Automate
Unanswered

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:
I have the same question (0)
  • Verified answer
    v-duann-msft Profile Picture
    on at
    Re: Saving SQL query results to csv on sharepoint

    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
    Re: Saving SQL query results to csv on sharepoint

    @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

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
Tomac Profile Picture

Tomac 497 Moderator

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 477 Super User 2025 Season 2

#3
chiaraalina Profile Picture

chiaraalina 242

Last 30 days Overall leaderboard