Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

How to download file in canvas app using file content?

(0) ShareShare
ReportReport
Posted on by

Hi Folks,

 

I have a canvas app connected to SharePoint via power automate. A service account is used for all connections in Power automate flows thereby removing the need for end users to have any access to backend SPO. The only challenge is when users need to download attachments/files from list/libraries. If we give the SPO URL it will return access denied for users. The flow can certainly get the file content and send it back to canvas app. Is there anyway to let the users download the file using this content from canvas app? I'm not interested in again storing this file content in other data source and give them the link.

 

Any suggestions?

 

Thank you!

  • rbn_nue Profile Picture
    rbn_nue on at
    Re: How to download file in canvas app using file content?

    Hi @BCBuizer 

     

    Thank you for the suggestion. Will try this and let you know how it goes.

     

  • BCBuizer Profile Picture
    BCBuizer 21,809 on at
    Re: How to download file in canvas app using file content?

    Hi @rbn_nue ,

     

    Passing files between Power Apps and Power Automate is not possible. The workaround from Power Apps to Power Automate is to pass the file name and file contents as text and then use those to create a file in Power Automate. Unfortunately there's no function to create files in Power Apps, which is why this doesn't work the other way around.

     

    If you want users to be able to download files directly from the Power App, you'll have to share them with the user.

     

    Having said that, you might consider creating two flows to share / unshare a file and then in Power Apps sandwich a Download function between them. In pseudo code:

     

    FlowToShareFile.Run(File.ID);
    Download(File.URI);
    FlowToUnshareFile.Run(File.ID);

     

  • rbn_nue Profile Picture
    rbn_nue on at
    Re: How to download file in canvas app using file content?

    Hi @BCBuizer ,

     

    Thanks for the suggestion. We already do that for reports that take time to generate. But these attachments/file which are already available on click are expected to be downloaded on the spot. 

     

    Thanks.

  • BCBuizer Profile Picture
    BCBuizer 21,809 on at
    Re: How to download file in canvas app using file content?

    HI @rbn_nue ,

     

    Perhaps it's an option to have Power Automate send the file to the user in an Email?

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,580

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,909

Leaderboard