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 Apps / Download documents usi...
Power Apps
Answered

Download documents using Download Function

(0) ShareShare
ReportReport
Posted on by 56

Download fucntion opens the given link in browser instead of downloading the document.
Syntax: Download(link to item)
How to directly download without opening the link ?

Categories:
I have the same question (0)
  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @abhishek_123 ,

     

    Please try this:

    Launch("https://<domain>.sharepoint.com/sites/<Site Name>/_layouts/15/download.aspx?SourceUrl=/sites/<Site Name>/"&ThisItem.'Full Path')

    For example:

    Snipaste_2020-05-22_15-34-29.png

    Hope this helps.

    Sik 

  • abhishek_123 Profile Picture
    56 on at

    This shows a error. My files are inside the shared documents 

     
    TestImg.PNG
  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @abhishek_123 ,

    Yes, my test and codes work well for the sharepoint document files. 

    It looks like that you defined a wrong <SiteName> and <Domain> in the launch URL. Could you please share the code in your scenario?

    When you open the sharepoint documents page, you can find the link shown as below

    Snipaste_2020-05-25_09-56-51.png

    Hope this helps.

    Sik

     

  • abhishek_123 Profile Picture
    56 on at

    Hi @v-siky-msft 
    I have One gallery connected to sharepoint documents which as a download icon, onSelect porperty of the icon I used the code which you suggested. I found the issue is when I Filter the Documents in items porperty of Gallery and click on download icon it opens a new tab and throws File not found error.
    If I directly pass the Documents without filter in gallery items then the file gets downloaded properly, but in my requirement I have to filter the documents as per the given path:
    Eg: Filter(Documents,'Folder path'="Some Path/")
    Not sure why this happens, If you find a solution please let me know.


    Download_Icon_Code.PNG
    With_Filter_in_Gallery_items_ThrowsError.PNG
    Sharepoint URL.PNG
  • v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @abhishek_123 ,

     

    Could you share two complete launch links? one for success, one for failure.

    I want to check if there is any difference between two link.

    Sik

  • abhishek_123 Profile Picture
    56 on at

    Hi @v-siky-msft 
    There is no change in link code, only change I make is with the filter in items property of gallery even This.path returns Exactly same path for both the scenario.
    You can test in but just adding a filter to the galley and then try the link to download

     

  • Verified answer
    v-siky-msft Profile Picture
    Microsoft Employee on at

    Hi @abhishek_123 ,

     

    Yes, I have tested, and it all works perfect. Please see the GIF.

    I find the error only happens when you are trying to download the Folder.

    GIF_76.gif

    Hence, I think you need to provide more information to help me reproduce your issue.

    Sik

  • abhishek_123 Profile Picture
    56 on at

    Hi @v-siky-msft 
    I found the issue was the folder name had "&" symbol in it when it is passed in url it shows error.
    My folder name was "Logo & Branding", this was the issue and than i changed it to "Logo and Branding" Now it workes fine,

    Thank you for helping

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    EDIT: I solved my own problem, in the second 'Site name' I didn't actually have the site name, I had the folder name!

     

    Hi @v-siky-msft ,

     

    Sorry for hijacking this thread however I cannot get this to work at all. I've created my URL as you've suggested above but I am still getting an error message.

     

    I may need a slightly different solution because I am pulling my sharepoint files from a flow rather than directly from the sharepoint site itself but all the information is there as you have above.

     

    Please see my URL below:
    https://<domain>.sharepoint.com/sites/<site name>/_layouts/15/download.aspx?SourceUrl=/sites/<site name>/<folder name>/<file name with extension>

  • Crissceron Profile Picture
    65 on at

    Its work fine... just does any one have the solution to download folders using this??

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard