Showing results for 
Search instead for 
Did you mean: 
Helper III
Helper III

Downloading a document in powerapps

Hello 🙂


in my powerapps i have a gallary with a sharepoint online document library - i have a download button with the following code:


onselect : Download(documenturl&"download.aspx")


this works perfectly well in chrome and downloads a copy for the user - however in Internet Explorer it does not download a copy instead it opens it from the server and then errors when the user tries to edit (as they dont have edit rights.) all i want it to do is download a copy.


Does anyone know why this is an issue and what i need to do to workaround this?





Community Support
Community Support

Hi @Helen_BB,


To download file from SharePoint library in PowerApps, you could use the Link to item column directly. You do not need to add the 

"download.aspx" in the end of URL.


I just tested with below formula in IE:


When selecting this button, the download pop-up shows and I can save the file correctly.


DataCardValue15 is the label control's name that holds the Link to item column inside the details form:





Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi, thank you for your help.

Unfortunately this just opens up the file from the server rather than downloading the file. i only have the option to open and not to save as? (see attachment) 


when it is open its a read only file from the server. when errors when you try to edit 😞 


any ideas?




I found an alternate solution for this. I dont know if this has been explored or not. 

In my case, i found that the document file name with extenstion and Etag were the factors to consider.

I created a flow which gives the etag for the file which needs to be downloaded and we can just append the etag with the site url and use the Download function with the OnSelect of the button for download in powerapps like so : Download("https://<Your site URL>/_layouts/15/download.aspx?UniqueId="&etag);

Here "etag" is what you get from the flow as shown in the screenshots.

Before you write the Download function as mentioned above, you need to use a var like 'filepath' like so: 

Set(filePath,First(idattach_2.Attachments).Value&First(idattach_2.Attachments).Name) where idattach_2 is name of the attachment card. The 'Name' here would be '{FileNameWithExtension}' and 'Value' would be '{Path}' of the attachment card.

This 'filePath' will be the input parameter for the flow that returns the etag.



I used a flow (not the one you suggested) to get the ETag for the file I want users to download. Then I added it to the formula you suggested:


Download("[SITE URL]" & "/_layouts/15/download.aspx?UniqueId=" & "ETag")


This does nothing. Does it need to be the FILE URL instead of the SITE URL? What part of the URL needs to be replaced with the "/_layouts/15/download.aspx?UniqueId="? Please let me know.

Sorry for replying late, the URL needs to be the site url.

See if the popup to download file is blocked.



Download("https://<ur organization domain><SITE Name>/_layouts/15/download.aspx?UniqueId..." & etag);


Example: XYZ/_layouts/15/download.aspx?UniqueId=D0BB0BFC-8117-4D7A-90AA-3EBE6D63A08D

You can use this URL:


"http://<site URL>/_layouts/download.aspx?SourceUrl=/sites/sitename/library/folder/fileName.ext"


It's works with PowerApps.

Thank You @DavidAR for this , i just did it with Powerapps,and it work really fine.

Not applicable

Thanks I solve the issue with this! 

Not applicable

@DavidAR i am trying to workout your solution for the download button but it says the document isn't found.

Helpful resources

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,814)