The target in the Launch function in Power Apps Microsoft Power Apps Launch in Power Apps

The Launch function in Power Apps helps you to open links in your browser from your app.

Launch Function

The launch function has had a few additional options added recently, and even though they are apparently still in preview they are worth it to have a look at.

Open a site using Launch

The simplest example is shown below.

Launch("SharePains.com")
The target in the Launch function in Power Apps Microsoft Power Apps image 28

When you click on the button the site will be opened. Notice that you don’t have to supply the https part of the url although you could do so.

Use query parameters in Launch

There are 3 options to add query parameters. Any of the below options will work.

Launch("Google.com/search?q=SharePains.com")
Launch("Google.com/search","q","SharePains.com")
Launch("Google.com/search",{q:"SharePains.com"})
The target in the Launch function in Power Apps Microsoft Power Apps image 29

The 3rd options however is the best option to use as we will see shortly.

Set the LaunchTarget

There is now an additional parameter available if you use the json format to supply the parameters.

The first option is New, which will open the link in a new tab.

The target in the Launch function in Power Apps Microsoft Power Apps image 30

The other option is Replace, which will replace the content in your current window.

The target in the Launch function in Power Apps Microsoft Power Apps image 31

Note that this only works when you are in the player. In development mode even though you specify replace the url will still be opened in a new tab. I’m actually quite glad that this is the case as I would permanently forget to save my work first.

Also an important thing to note is that the target above is actually set to _self.

You can also simply set the target to a text value instead of using the New or Replace as shown above. More on this can be found at the target documentation.

Calling apps from Power Apps using Launch

Now you could create an app that calls other apps. as shown below.

Launch("https://apps.powerapps.com/play/18295fb3-4723-4388-80d2-09ca5217a2f8",{tenantId:"..."}, Replace)
Use the Launch function to open a new app in the same tab

This works really quite well, the only thing that I noticed is that once again this only works in play mode and when you are testing this in development mode a new tab is opened.

Additionally when you use the Launch function in Development mode, the app is opened in Development mode as well, rather than in play mode.

So with this new feature it is now possible to have multiple apps launching in the same tab making them almost feel like one app.-

Avatar for Pieter Veenstra

By Pieter Veenstra

Business Applications Microsoft MVP working as the Head of Power Platform at Vantage 365. You can contact me using contact@sharepains.com

8 thoughts on “The target in the Launch function in Power Apps”
  1. Is it possible to launch another app in the current Iframe when the current powerapp is embedded in an iframe. It instead opens it in the parent window when using Replace. My thoughts are that target=’_self’ would generally open a link in the current iframe.
    Thanks
    Danny

  2. Hi

    I am launching a CRM URL from canvas button click using Launch() in embedded canvas app in CRM
    When am using browser the button click will open the record in a new tab
    But when am using the Mobile app it is still opening in browser how to open the URL in Mobile CRM native app

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from SharePains by Microsoft MVP Pieter Veenstra

Subscribe now to keep reading and get access to the full archive.

Continue reading