Model-driven apps are a powerful way to build data-centric business applications in Power Platform. But when it comes to user experience, one feature that can really elevate your app is deep linking—the ability to send users directly to a specific record, view, or form inside your app.
In this post, we’ll explore how to implement deep linking using Table Model-Driven Apps.
For this example we will get the link directly to an account record for our app.
The structure for the link will look something like below:
https://.crm.dynamics.com/main.aspx?appid=&pagetype=entityrecord&etn=&id=
We can quite simply construct together by getting the url from within our app and changing the record GUID which would work.
However the issue with this is that once we deploy this through to a Test > UAT > Prod environments is that the url of the app will change and the app id will also change therefore leaving us with a URL that doesn’t work in those environments.
1st Way - More Configuration Needed
One quick way to do this is to store both the Environment ID and the App ID in environment Variables, however doing this requires some configurations and then requires deploying additional objects etc, which seems a bit unnecessary
2nd Way - Best Option
Dataverse already stores all the information you need without having to set up environment variables and make sure there all set up correctly. Starting with the environment URL. As we are getting a record ID, we can use action ‘Get a row by ID’ and use the odata from the dynamic content.
This will return something like below which gives us the environment URL

As this includes data we don’t need we can just get everything before the /api/ by using split expression
split(outputs('Get_a_row_by_ID')?['body/@odata.id'],'/api/')[0]
Now we have the url the next part of the URL we need is the app id.
Within Dataverse there is actually a table that stores this called ‘Model-Driven Apps’. We simply need to filter by ‘name’ for the app we are linking to which will give us the app ID

Using dynamic content we can now get the app id. use the ‘AppModuleid’ from the dynamic content.
As list rows will output an array even if we only return 1 record we can prevent the apply to each by using an expression to get the first record. which will look something like below:
outputs('List_rows')?['body/value']?[0]?['appmoduleid']
Finally we just need to get the record id and then we can put everything together. For this step we just need to get ‘accountid’ from the initial record which will look something like below
outputs('Get_a_row_by_ID')?['body/accountid']
Now we have all three bits of information we need to put the url together we can use concat to create the url
concat(split(outputs('Get_a_row_by_ID')?['body/@odata.id'],'/api/')[0],
'/main.aspx?appid=',
outputs('List_rows')?['body/value']?[0]?['appmoduleid'],
'&pagetype=entityrecord&etn=account&id=',
outputs('Get_a_row_by_ID')?['body/accountid'])
The output then constructs a full deep link url to the record:
