Categories: 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 and Office Apps & Services Microsoft MVP working as a Microsoft Productivity Principal Consultant at HybrIT Services. You can contact me using contact@veenstra.me.uk.

View Comments

Recent Posts

Calculate the Sum for a SharePoint column in Power Automate

Last week Shane Young asked me about calculating the Sum for a SharePoint column in…

3 hours ago

Object must implement IConvertible in Power Apps

In Power Apps when you do a Patch to create a new item or to…

4 days ago

Get started with adaptive cards in Power Automate

Getting started with adaptive cards can be difficult. In this post i have written some…

1 week ago

Create PDF documents from data in Power Automate

In this post I will look at how to create PDF documents from data. Use…

2 weeks ago

Unnest nested arrays in Power Automate

We all know this problem, you have a nested array in Power Automate but how…

3 weeks ago

Advanced settings not loading in Power Platform

Yesterday one of my clients showed me an issues where the Advanced settings didn't load.…

4 weeks ago
%%footer%%