Skip to main content

Notifications

Community site session details

Community site session details

Session Id : zJPIJZfZEQHpOQKjN3bRz6
Power Apps - Building Power Apps
Unanswered

How to download file in PowerApps sent from Power Automate

Like (1) ShareShare
ReportReport
Posted on 9 Apr 2021 15:38:56 by

I have a canvas app with a screen that shows a list of files associated with the data currently being viewed. Those files are stored in a SharePoint library that the app user does not have access to. In order to view the file list, upload additional files, or delete files, the app sends a request to a Power Automate flow, which then uses an HTTP action to call another flow. This second flow then performs the requested CRUD operations.

 

I have the "create," "update," and "delete" parts of CRUD working fine, but not the "read" part. On the screen, there is a gallery in which each item is a file in the list. In each item is a button that should allow the user to download the respective file. I can build a pair of flows that will read and send the requested file data to PowerApps, but I can't find a way to then have PowerApps save the file to the user's default download folder (or any folder). Once my flow sends the file data to PowerApps, how do I instruct PowerApps to save that file to the user's computer?

 

I have looked into the Download() function, but I don't think this will work, because I need to have a URL that is accessible to the user. Due to security reasons, the SharePoint library containing the files cannot be made directly accessible to the users, which is why I'm using a set of flows to accomplish this. I want PowerApps to save the file that it receives from Power Automate directly.

Categories:
  • rbn_nue Profile Picture
    on 19 Sep 2022 at 06:13:31
    Re: How to download file in PowerApps sent from Power Automate

    Hi @zmorek 

     

    Thank you for this suggestion. Although is there anyway we can pass the actual content of file from power automate to power apps and let the user download it (This will skip the steps of storing a copy elsewhere).

     

    Is this possible?

     

    Thank you.  

  • anibra Profile Picture
    278 on 17 Nov 2021 at 13:06:59
    Re: How to download file in PowerApps sent from Power Automate

    Thank you @zmorek . I found a way how to do that. This video was very helpful:
    https://www.youtube.com/watch?v=QTbVMu6DIfQ&list=PLK4GUAjzwV6FyI0Jh9gHuYBrz4P3e9R6Z&index=40&t=1719s

  • zmorek Profile Picture
    3,272 on 17 Nov 2021 at 12:58:08
    Re: How to download file in PowerApps sent from Power Automate

    You could consider something like:

     

    1. User clicks a button in PowerApps.
    2. PowerApps calls a Power Automate flow.
    3. Flow gets the file content and metadata from SharePoint.
    4. Flow creates copy of file in library that user has permissions to access
    5. Flow returns the file data to PowerApps.
    6. Flow passes URL of file to PowerApps
    7. PowerApps Launch() URL
    8. PowerApps saves the received file data to the local disk.

     

    With this you'd probably need to consider some Flow to automatically purge the "temporary" files it creates.

  • anibra Profile Picture
    278 on 17 Nov 2021 at 09:23:02
    Re: How to download file in PowerApps sent from Power Automate

    Hi @Anonymous, have you found a solution to your problem yet? I have such a scenario and I could not find a way to do it

  • Community Power Platform Member Profile Picture
    on 23 Apr 2021 at 18:31:32
    Re: How to download file in PowerApps sent from Power Automate

    Hi, @JoaoN.

     

    Sorry for the delay; I was pulled away from this for several days.

     

    Unfortunately, while that video is very helpful for downloading a file from OneDrive, it doesn't address how to download a file from SharePoint. The problem is, his method requires the file to be made available to everyone via a link. However, the file in my SharePoint library needs to remain secured, and accessible only via PowerApps/Power Automate. Ideally, the event would follow something like this...

    1. User clicks a button in PowerApps.
    2. PowerApps calls a Power Automate flow.
    3. Flow gets the file content and metadata from SharePoint.
    4. Flow returns the file data to PowerApps.
    5. PowerApps saves the received file data to the local disk.

    The only real step that I cannot figure out here is step #5. I can build a flow that does return the file metadata and binary content to PowerApps, but I can't figure out how to have PowerApps save that incoming data to disk.

  • JoaoN Profile Picture
    222 on 09 Apr 2021 at 18:43:20
    Re: How to download file in PowerApps sent from Power Automate

    Did you try to use the Launch function?
    I do not know if is that your purpose, but Daniel Christian talks about downloading CSV file from a Filtered Gallery on this video. Maybe it can be useful to you:

    https://www.youtube.com/watch?v=QTbVMu6DIfQ&list=PLK4GUAjzwV6FyI0Jh9gHuYBrz4P3e9R6Z&index=38&t=1719s

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,731 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,077 Most Valuable Professional

Leaderboard