cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Lam01007
Advocate III
Advocate III

Flows to download a file

Hi All,

 

I have a flow to generate a file. Now it can be upload to a SharePoint document library, or send it out through email.

But I would let user directly download the file from their browser once they click to start the flow.

 

Any solution?

 

Thanks,

 

Lam

8 REPLIES 8
manuelstgomes
Super User
Super User

Hey @Lam01007 

 

Sure there is. Once you have the file in SharePoint you can use the following:

 

small-Screenshot 2019-10-17 at 09.46.48.png

 

Once you get the link you can email it, send it as a notification, or do whatever is appropriate.

 

Is this what you're looking for?

 

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

Thanks for your reply, but I am looking for directly download file from web browser.

 

Just like you click "Export to Excel" button, and the browser will prompt for you to select location for store the file.

 

Hi @Lam01007 

 

Probably someone else knows a way to do that, but I don't think it's possible. You need to wait for the file to be in SharePoint to be able to share (download) it after. 

 

Sorry 😞

 

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Cheers
Manuel

abm
Super User
Super User

Hi  @Lam01007 

 

Flow process are serverside.  Work around is you can use a onedrive where you can download the file from SharePoint using flow.

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blogPower Automate Video Tutorials
Gristy
Resident Rockstar
Resident Rockstar

Flow does not store files, you need to use other things for that, your best bet is to link them to the SharePoint library you are saving in

ChristopherBor
Regular Visitor

Hi

For other people that stumble upon this question:

It does not seem that a direct download is possible, however I have found the following workaround:

Use Flow to create a file and then a shareable link, and send that url back to powerapps:

 

Screenshot 2020-09-25 at 12.25.17.png

 

Then in powerapps, use the following:

Set(VarFileURL, ExportReportToCSVTeam.Run(VarFormattedJsonReportExport));
Download(VarFileURL.reports_csv)

VarFileURL is the name I give the variable which will be populated with the url for the download function
reports_csv is the name I gave the Shareable link
ExportReportToCSVTeam is the name of my flow
VarFormattedJsonReportExport is the variable I send to the flow to create the file

More about the download function:
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-download


Not sure how you're implemented the Download function, but you can't use those Flows steps, Create File, Create Share Link, Respond to a PowerApp or Flow (with OneDrive or Sharepoint).  That will throw an error like this:  It
The workflow with 'Response' action type should not have triggers with 'splitOn' property defined: 'manual'.'."}}". Code: 0x80060467 InnerError: '.

Another possible flaw with this method, is that the file may not exist yet to download.  It's being saved to the cloud.  You're assuming you can create, and then download a file instantly. 

Another option is to create a custom button that has javascript to trigger an HTTP request in Flow.  Then you can send the document back via a "Response" action.  You'd have to set the request headers to the correct content type.

Well I know that I can do it, because I have been doing it for close to two months, so I don't think the error you are getting is because of those three steps.

 

I am presuming that when an output from a former step is part of a step in a workflow, it waits until that action is completed before executed. In this I may very well be wrong, but at least for the csv files of the size I create, there has yet to be any issues.

 

I have no doubt a better solution could be concocted, and I would very much like to see an example of the custom button you suggest, it sounds like a very good solution.

 

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,848)