Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
World desk3 min

Deep Linking in Power Apps Code Apps: Yes, With One Important Twist

Power Apps Code Apps can receive URL query parameters through getContext(), but your app must turn the value into navigation. Here’s how to build and handle a deep link.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Yes—you can pass a URL query parameter to a Power Apps Code App. The twist is that receiving the parameter does not automatically open a screen or record: your app must read the value and use its own routing or view-selection logic.

How Code App deep linking works

A Code App is a code-first web application that can use frameworks such as React or Vue while integrating Power Apps capabilities. Its SDK exposes launch context through getContext(), including URL query parameters at context.app.queryParams. Your code decides what those parameters mean and what view to show. Microsoft’s context documentation describes the API, and Microsoft’s PowerAppsCodeApps repository includes a Dataverse context-routing sample.

Build a link with an app-defined parameter

Microsoft documents this Code App play URL shape for embedding:

https://apps.powerapps.com/play/e/{environmentId}/app/{appId}?tenantid={tenantId}

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The tenant parameter is optional in that embedding guidance. To pass a record identifier, append an application-owned parameter such as recordId:

https://apps.powerapps.com/play/e/{environmentId}/app/{appId}?tenantid={tenantId}&recordId={encoded-id}

If the base URL has no query string, start one with ?recordId=... instead. Encode the value as appropriate for a URL. recordId is an example key your app defines, not a reserved Code Apps route format. The documented play URL and embedding requirements are in Microsoft’s iframe embedding guide.

Read the parameter and route deliberately

The SDK call is asynchronous. A minimal illustrative shape is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
import { getContext } from '@microsoft/power-apps/app';

const context = await getContext();
const recordId = context.app.queryParams.recordId;

// Validate the supplied ID, then pass it to your app's router or view logic.

This shows how to obtain the value; it is not a complete app or a tested implementation. Microsoft’s context documentation also describes other returned context, including app and environment identifiers, Dataverse organization URL, app URL, user metadata, and session ID. Treat a query parameter as untrusted input: validate and normalize it, then use your existing data layer and authorization checks. A record ID in a URL is a navigation hint, not permission to access that record.

Choose how the app responds

There is no single built-in Code Apps route table implied by the query-parameter accessor. Your architecture determines how the value selects a destination.

Approach Useful when Engineering considerations
Use the app’s router The app already has routes or needs nested destinations. Integrate the parameter with the router’s route and data-loading logic. History, refresh behavior, and route setup depend on the framework and app implementation.
Select an initial view in app state The app has a small number of views and does not need a full route system. Read the parameter at startup, validate it, and select an allowed view. Refresh and browser-history behavior must be designed if the selected view needs to persist.

Microsoft’s repository contains both a DataverseContextRouting sample for selecting an initial Dataverse page from query parameters and a TanStack Router sample. These are examples, not a Microsoft ranking of approaches or a guarantee about deployment behavior. Check the samples in the repository against your app’s framework and needs.

Code Apps and canvas-app deep links are different

Canvas apps have a separate deep-link pattern using the formula functions Param() and StartScreen. Those instructions are for canvas apps, not the Code Apps SDK. For a Code App, read query parameters from getContext() and connect them to your own routing or view logic. See Microsoft’s canvas app deep-link tutorial for that distinct approach.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Keep platform URL options separate from app navigation

Microsoft documents hideNavBar=true as a play-URL option to hide the Power Apps header. It changes platform chrome, not the app’s selected page or record. When the URL already has a query string, append the option with &. Details are in Microsoft’s Code Apps system configuration documentation.

Test the link in its actual launch context

Test the published play URL with the parameter present and absent, and verify that invalid or missing values produce a safe, useful result. If the app is embedded, test from the intended host as well: the embedding guide says access is limited to Power Apps users in the same tenant, and an external host may require an administrator to configure the environment’s CSP frame-ancestors directive. Refresh and browser-history behavior are app implementation details; do not assume every host preserves a custom route automatically.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

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

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.