Download a File from a Canvas Power App using a button | Power Platform

Let’s say you give a simple button to download a standard PDF file to the user. It could be a pre-defined file which already exists somewhere and your App readily has the URL to the file. You only need to provision a button to the user to download and they can simply click it and download the file to the device.

Let’s see how!

Scenario

Let’s say salespeople in your organization have access to Accounts and each Account has an exclusive Document to that Account, say, some type of Agreement/Whitepaper.

For simplicity, I’m storing the URL of the Document in a field. However, you can have a different (and better) ways to represent this. Finally, all you need is a URL to the file to be downloaded.

Download button

Here’s how I’m implementing it. To keep it simple, I’m only reading from the field on my Accounts, called as Agreement Doc URL.

Consideration: To keep this post simple, I didn’t go into the SharePoint Access settings, etc. Make sure the file is hosted over the internet and doesn’t have to go through a lot of settings to be accessible.

  1. Here’s my Gallery that shows all the Accounts.

  2. When I make a selected to any of the records, it’ll open the Form and pre-populate the form with the selected record. However, your application could be anything.
  3. I’ll place a button on click of which, I’ll write the Function to download a file.

  4. And the function used it Download()

    In my example, I’m choosing to download the file which is supposedly coming from my AccountView (which is a Gallery). Selected method is pointing to the row from my CDS Data Source which I selected in the Gallery and navigated to the Formevery of my Account records have their own respective URLs and Agreement Doc URL is the name of the field in which the URL to the document resides.

    Here’s Microsoft Document on this function – https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-download/?WT.mc_id=DX-MVP-5003911

Working

Hope this helps! Here are some more Canvas Power Apps related posted you might want to check out –

  1. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
  2. Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate
  3. Accept HTTP Requests in a Flow and send Response back | Power Automate
  4. Terminate a Flow with Failed/Cancelled status | Power Automate
  5. Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists
  6. ChildFlowUnsupportedForInvokerConnections error while using Child Flows [SOLVED] | Power Automate
  7. BPF Flow Step as a Trigger in CDS (Current Environment) connector | Power Automate
  8. Pause a Flow using Delay and Delay Until | Power Automate
  9. Generate Dynamics 365 record link in a Flow using CDS connector | Power Automate
  10. Text Functions in a Flow | Power Automate
  11. Loop through array of objects in a Flow & Create records in CDS | Power Automate
  12. Get Count of records retrieved in CDS connector in a Flow | Power Automate

Thanks.

One thought on “Download a File from a Canvas Power App using a button | Power Platform

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.