Hi @Phineas ,
Parameters are passed in the URL once, when the app launches.
The idea with parameters is that sometimes you want to add some context to an app launch, instead of just launching it to the standard landing page.
For example let's say you have a landing page where the user is presented with a navigation menu. They can go look at a few screens, one of which contains gallery of items and if they select an item it takes them to a page where they can view an item.
Now, let's say you have some automation that sends the user an email when an item changes, saying "something happened, click here to go see it" with a link to your app - except you want to take your user straight to the item view page, so they don't have to start at the home page and then click through everything and go find that item - because the 'context' of their email is that a specific item changed.
This is where query parameters become handy.
If you control the email you send to them, you control the link for them to click which will launch the app, meaning you can pass information to the app inside the URL - a query parameter is a variable contained within the URL of the link - for example "name=Bob" or "myVar=something" or "itemID=23".
Query parameters have been around long before PowerApps came along. To understand a bit more, it helps to understand how they are constructed.
Query parameters can be added to a web address to pass information along to a resource listening at that address.
For example;
https://www.somwebsite.com
is a URL. If there was a web service or something at that URL that understood some parameters, you might see an address like;
https://www.somwebsite.com?name=Bob
Query parameters in URL's are universally recognised as starting with ?
Additional parameters are added using &
https://www.somwebsite.com?name=Bob&myVar=something&itemID=23
note the placement of the ? and the subsequent &'s
PowerApps are web apps, and so they can run in a browser - when you click on a power app to run it, you are activating a link. This link you've already found in app details.
If you look closely, your PowerApp probably already has a parameter, like "tenandId" eg:
"https://apps.preview.powerapps.com/play/some-long-App-identifier?tenantId=some-long-tenant-identifier"
This link will launch your app - so if you copy and paste that link into an email and send it to someone and they click the link or copy and paste it into their browser - and it will launch your app.
Using this capability you can add parameters to that link by editing it in the email before you send it - just keep the original address as is, and (because "tenantId" has already started the query with ?), append your parameters to the address using & - like so;
https://apps.preview.powerapps.com/play/some-long-App-identifier?tenantId=some-long-tenant-identifier&name=Bob&myVar=something&itemID=23
Now that you have an app URL that is loaded with parameters, you have to tell your app what to do with them.
On the app side, you use the Param() function to pick up those parameters and use them in your app - typically by referencing them directly, or assigning them to variables - for example in your app OnStart: property;
Set(varName = Param("name"))
//or
Set(varMyVar = Param("myVar"))
//or
Set(varItemId = Value(Param("itemID")))
note that parameters always come through as text, because they are part of a text string which is the URL. If itemID needs to be a number in your app, you have to convert it with something like the Value() function.
You can then use this information in your App - for example in OnStart: or StartScreen: properties, let's say we want to send the user straight to the form view page to view that specific itemID when they click our custom URL;
Assuming the above already exists in your app OnStart: property, then this could go into your StartScreen: property;
If(!IsBlank(varItemId),
//there is a value for itemid in the url so navigate directly to the form page on start
formViewScreen,
//otherwise if there is no parameter specified, just load the normal start screen
HomeScreen
)
Then your Form Item: property can be set to reflect the specific record specified
LookUp(mySource, ID=varItemId)
There are 100 different ways you can use this to affect the user experience depending on how they launch the app - the basic principle however is pretty simple;
This only works when launching an app from a custom link that you create. The link can be activated from any mechanism that opens websites from a link (there are 100's of ways to do this - Email link, website, Launch() function in one PowerApp to open another PowerApp, Teams link, IM, SMS etc.) - as long as it's your custom link and not the native app launch from the library, because then it's using the default link which contains none of your parameters.
Hope this helps,
RT