Microsoft Power Apps

The target in the Launch function 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")

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 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 other option is Replace, which will replace the content in your current window.

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)

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.-

Share
Pieter Veenstra

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

View Comments

  • 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

  • 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

Recent Posts

Introducing 8 AI Functions for Dataverse in Power Apps

Recently Microsoft added AI Functions to Dataverse that can be used in Power Apps. In…

23 hours ago

Copy and paste Scope steps in the new Power Automate Designer

One of the outstanding issues with the new Power Automate Designer is Copy and Paste…

1 week ago

Receive the available storage within your SharePoint Online tenant

Within the SharePoint admin centre there is that little detailed overview, telling you the available…

4 weeks ago

Options for Documenting Your Power Apps: Comments, Code, and Controls

Within Power Apps there are various ways to document your app. In this post I'm…

1 month ago

2 ways to duplicate SharePoint Lists to support your Power Apps

Recently I've been asked quite a few times to duplicate SharePoint lists as part of…

1 month ago

Update a Hyperlink Column in SharePoint with Power Automate

Today, I was asked about how to create a lookup to a document or item…

1 month ago