Post

#PowerPlatformTip 67: 'App-to-App Redirection'

#PowerPlatformTip 67: 'App-to-App Redirection'

TL;DR: In the old app, put Launch("<web link of the new app>", {}, LaunchTarget.Replace) in the OnVisible of the start screen. Users who open the old link land in the new app, in the same browser tab. Copy the web link from the new app’s Details page, and share the new app with the same users first.

💡 Challenge

You rebuilt an app, often in another environment. The old link lives in bookmarks, Teams tabs, emails and SharePoint pages, and you can’t update all of them at once. You want everybody who opens the old app to end up in the new one.

✅ Solution

Turn the old app into a redirect. The Launch() function opens a web page or another canvas app, and with LaunchTarget.Replace it replaces the current browser tab instead of opening a new one. A short notice on the screen covers the cases where the redirect can’t happen automatically.

🔧 How It’s Done

1. Get the web link of the new app.

🔸 Power Apps > Apps > select the new app > Details > copy the Web link. It has this format:

1
https://apps.powerapps.com/play/e/<environment-id>/a/<app-id>?tenantId=<tenant-id>

🔸 Share the new app with the same users or groups as the old one, otherwise the redirect ends on an access error.

2. Redirect from the start screen of the old app.

🔸 Old app > start screen > OnVisible:

Launch(
    "https://apps.powerapps.com/play/e/<environment-id>/a/<app-id>?tenantId=<tenant-id>",
    {},
    LaunchTarget.Replace
)

🔸 The record form {...} is the only form of Launch() that accepts a LaunchTarget.

3. Forward deep-link parameters.

🔸 If the old app was opened with parameters, for example &recordId=42, hand them over. Parameters for a canvas app go into the record, not into a query string:

Launch(
    "https://apps.powerapps.com/play/e/<environment-id>/a/<app-id>?tenantId=<tenant-id>",
    {recordId: Param("recordId")},
    LaunchTarget.Replace
)

🔸 The new app reads it with Param("recordId"). Parameter names are case-sensitive and the value always arrives as text.

4. Show a fallback on the screen.

🔸 Put a label and a button with the same Launch() on the start screen: “This app has moved. Open the new app.” Users see it if a pop-up blocker or a host stops the automatic redirect.

5. Communicate the change.

🔸 Tell users about the new link and ask them to update bookmarks and Teams tabs. Retire the old app once its usage drops to zero.

🎉 Result

Every old link keeps working and leads to the new app, while you replace the links at your own pace.

🌟 Key Advantages

🔸 No broken links: bookmarks, Teams tabs and emails keep working during the changeover.

🔸 Same tab: LaunchTarget.Replace avoids a second browser tab with the old app.

🔸 Context preserved: parameters such as a record ID travel to the new app.

⚠️ Good to Know

🔸 Embedded hosts: in Power BI, SharePoint and other embedded scenarios, a LaunchTarget other than New is not supported. Keep the fallback button for apps that are embedded.

🔸 Mobile: in the Power Apps mobile app, launching another canvas app always replaces the current app. If the new app is already open on the device, its parameters only refresh after a reload.

🔸 Behavior formulas only: Launch() works only in behavior formulas. The OnVisible of the start screen is one, and it runs as soon as the app shows its first screen, next to the visible fallback.

🛠️ FAQ

1. How do I trigger the redirection?

Call Launch() with the new app’s web link and LaunchTarget.Replace in the OnVisible of the old app’s start screen.

2. Can I still access the old app?

Yes, but every visit redirects. Makers still edit it in Power Apps Studio, and the fallback button on the start screen stays available if the redirect is blocked.

3. Can I pass parameters to the new app?

Yes, in the record argument of Launch(), for example {recordId: Param("recordId")}. Query strings added to the URL don’t work when launching a canvas app.

🔸 #PowerPlatformTip 53: ‘Launch Function’ - the full range of things Launch can do beyond redirecting to another app.

🔸 #PowerPlatformTip 159: ‘Direct File Download with Power Apps Launch()’ - another practical Launch() trick worth knowing.

This tip is by Marcel Lehmann, Microsoft MVP (Business Applications) and founder of the Power Platform Academy – live Power Platform workshops, free or CHF 49. Join the workshop waitlist to get notified about new dates. For companies that want this implemented for them, see KMUpower – Power Platform consulting & automation for SMEs (DACH).

This post is licensed under CC BY 4.0 by the author.

Microsoft and the Power Platform product names (for example Power Apps, Power Automate, Copilot Studio) are trademarks of the Microsoft group of companies. This is an independent website. It is not operated, sponsored or endorsed by Microsoft.