Overview
With just one button or icon, canvas app users can quickly access full records in a model-driven app with ease. The examples below demonstrate how to launch to a static URL or a dynamic URL that can be used in different environment.
YouTube
Add Icon or Button
Add a button or icon to your app. In the scenario below, we will add an Icon in a gallery.

Launch Hardcoded URL
In this scenario, the icon/button will be hardcoded to a specific environment.
- Select the icon/button
- Go to OnSelect in the property dropdown
- Update the OnSelect property to reference the URL path and the unique ID of the record you want to launch
In the formula below, the Launch() function is used to open a new window with the provided URL. The Concatenate() function is used to splice together two parts of the URL: the URL path leading up to the unique ID and the unique ID itself (in bold below).
https://org82938.crm3.dynamics.com/main.aspx?appid=17b6e73a-e73c-ed11-bba2-002248ae080f&forceUCI=1&pagetype=entityrecord&etn=account&id=d68405b5-171c-ed11-b83c-0022483cd788
The formula will look like the following. {urlName} contains the first part of the URL and ThisItem.AccountId references the unique ID of the Account in the gallery
Launch(Concatenate(“{urlName}“, ThisItem.AccountId))

Launch Dynamic URL
In this scenario, the icon/button will launch the URL based on the environment you’re in ex) DEV, UAT or PROD.
In your Solution, create two Environment variables with Data Type of Text. One will be used to house the main URL of the environment, and the second will house the model-driven app ID that can vary between environments.

The main URL, will contain the URL for your Power Apps/Dynamics environment. Example in bold below: https://org82938.crm3.dynamics.com/main.aspx?appid=17b6e73a-e73c-ed11-bba2-002248ae080f&forceUCI=1&pagetype=entityrecord&etn=account&id=d68405b5-171c-ed11-b83c-0022483cd788

The URL will an App ID for your model-driven app. Example in bold below:
https://org82938.crm3.dynamics.com/main.aspx?appid=17b6e73a-e73c-ed11-bba2-002248ae080f&forceUCI=1&pagetype=entityrecord&etn=account&id=d68405b5-171c-ed11-b83c-0022483cd788

Retrieve the environment details by:
- Go to your app in the tree view
- Select the OnStart property
- Retrieve the Environment variables
Set(mainURL, LookUp('Environment Variable Values', 'Environment Variable Definition'.'Schema Name' = "lcgco_MainURL").Value);
Set(modelDrivenAppID, LookUp('Environment Variable Values', 'Environment Variable Definition'.'Schema Name' = "lcgco_ModelDrivenAppID").Value);

- Select the icon/button
- Go to OnSelect in the property dropdown
- Update the OnSelect property to reference the environment variables and unique ID of the record you want to launch

In the formula below, the Launch() function is used to open a new window with the provided URL. The Concatenate() function is used to splice together five parts of the URL:
- the main URL for the Power Apps/Dynamics environment
- a static part of the URL
- the model-driven app id
- another static part of the URL
- the unique ID of the Account
https://org82938.crm3.dynamics.com/main.aspx?appid=17b6e73a-e73c-ed11-bba2-002248ae080f&forceUCI=1&pagetype=entityrecord&etn=account&id=d68405b5-171c-ed11-b83c-0022483cd788
The formula will look like the following:
Launch(Concatenate(mainURL, “main.aspx?appid=”, modelDrivenAppID, “&forceUCI=1&pagetype=entityrecord&etn=account&id=”, ThisItem.AccountId))
When selected, it will open the model-driven app record:

