Canvas Apps Expressions

Changes to the Launch function

Launch function in Power Apps
Launch function in Power Apps

What is the Launch function?

Launch function is used to launch a webpage or another canvas app. The syntax is as follows:

Launch( Address, { [ParameterName1: ParameterValue1, ... ] } , LaunchTarget ] )

where

  • Address is the URL of the webpage or App ID of the canvas app that needs to be launched
  • Parameters are any named values that need to be passed to the webpage or canvas app
  • LaunchTarget specifies the browser tab in which to launch the webpage or canvas app

Need for changes

LaunchTarget had two allowed values (in line with HTML code):

  • Self - to have the webpage or canvas app open in the same tab
  • Blank - to have the webpage or canvas app open in another tab

However, soon after, the Power Apps team released a new operator - the Self operator. The Self operator provides an easy access to the current control. This can be useful when referencing another property of the same control. For example, if you have a button called Button1 and you want to set its HoverFill property to its Fill property, you can obviously populate the two properties with the same color but this will need to be maintained every time the Fill property is changed. The only other way this was possible before the Self operator was to set the HoverFill property to Button1.Fill. With the Self operator, you can now set it to Self.Fill.

While this is very convenient, this conflicts with the Self launch target. So when the Self operator was added, the way to access the Self launch target changed to LaunchTarget.'Self'.

What are the changes?

With the Self operator in place, changes were made to the launch targets. The new values for launch targets are:

  • Replace - this is same as Self - use it to have the webpage or canvas app open in the same tab
  • New - this is same as Blank - use it to have the webpage or canvas app open in another tab

Summary

With the introduction of the Self operator, the Self and Blank enumerations for LaunchTarget within the Launch function have now been replaced by Replace and New respectively. Use Replace to have the webpage or canvas app open in the same tab. Use New to have the webpage or canvas app open in another tab

Related Articles

  1. Power Apps Formula Reference
  2. Clickable controls in a Display form
  3. Official documentation on Launch function
  4. Official release notes of Launch targets and Self Operator

2 thoughts on “Changes to the Launch function”

Leave a Reply