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!
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.
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.
- Here’s my Gallery that shows all the Accounts.
- 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.
- I’ll place a button on click of which, I’ll write the Function to download a file.
- 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
Hope this helps! Here are some more Canvas Power Apps related posted you might want to check out –
- Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
- Send a Power App Push Notification using Flow to open a record in Canvas App | Power Automate
- Accept HTTP Requests in a Flow and send Response back | Power Automate
- Terminate a Flow with Failed/Cancelled status | Power Automate
- Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists
- ChildFlowUnsupportedForInvokerConnections error while using Child Flows [SOLVED] | Power Automate
- BPF Flow Step as a Trigger in CDS (Current Environment) connector | Power Automate
- Pause a Flow using Delay and Delay Until | Power Automate
- Generate Dynamics 365 record link in a Flow using CDS connector | Power Automate
- Text Functions in a Flow | Power Automate
- Loop through array of objects in a Flow & Create records in CDS | Power Automate
- Get Count of records retrieved in CDS connector in a Flow | Power Automate