How to pass parameters to a Canvas App

AJ Zafar

AJ Zafar

Solution Architect

Why might you want to pass parameters to a Canvas App

There are many reasons why you might want to pass data into an app from the link, some examples of when I like to use them include:

  1. Pre-populate data in fields – You can use parameters to simplify data entry by pre-populating fields with default values. For instance, if you have a form that captures information about a customer, you can pass in the customer’s name, address, and other details to pre-populate the fields.
  2. Personalisation: Passing parameters lets you personalise the app for different users or groups. For example, you could pass in a user ID or department name to filter data or show personalised content.

  3. I also use them when integrating with the browser when building my low-code browser extensions.

How to pass parameters to a Canvas App

Step 1 - Name the Parameter you want to pass

This can be almost anything but it cannot be one of the reserved parameters. See the link below for a list of the reserved Parameters:

Reserved Parameters – Power Platform | Microsoft Learn

For my example, pass a Parameter called ‘customername’.

Step 2 - Use the Param() function to retrieve the parameter passed

I have added a label to the below screen and made it’s ‘Text’ property:
Param(“customername”)

Step 3 - Pass the value as a Parameter in the URL and see the result

Add the Parameter at the end of your URL. It will look something like this:
https://apps.powerapps.com/play/YOUR-APP-ID?tenantId=YOUR-TENANT-ID&customername=”AJ Zafar”

As you can see above the app has pre-populated the label with the value I passed through for ‘customername’.

Optional Step - How to save the Parameter as a variable

To avoid typing Param() multiple times in my apps, I like to set the Parameter’s value as a variable on Start to make it more convenient to re-use in my app.

Utilise the Set() function to create a variable for the Parameter like below:

Set(varCustomerName,Param(“customername”))

To sum it up:

Passing Parameters can be super useful, and I highly recommend you use them wherever they could add value, as your users will love you for it. Good luck on your Power Apps Journey!

AJ Zafar

AJ Zafar

Solution Architect

Leave a Reply

Your email address will not be published. Required fields are marked *