Use Navigate() function to pass data between two screens in PowerApps Canvas apps

Follow my blog for more interesting topics on Dynamics 365, Portals and Power Platform. For training and consulting, write to us at info@xrmforyou.com
Every now and then when you design a Canvas App, you may be required to accomplish the following requirements.

  • Pass data from one screen to another while navigating to the new screen.
  • Identity from which screen the user arrived on the current screen.
  • Contextual information that need to be shared only between two specific screens.

In canvas app, Navigate() is the function which is used to navigate from one screen to another. And while not known much, Navigate() function in-fact has an additional construct to pass contextual data to the next screen.
image
Pic courtesy : Microsoft Docs.
So let’s see how we can pass data between two screens. Below is the formula OnSelect of a button where we are browsing to the BrowseScreen1 and also passing in two variables

  • Variable1 – String value
  • Variable2 – Boolean Value

image

The method is similar on how we set a screen variable using UpdateContext() function. The very good thing with this Navigate() construct is the variables will only be available in BrowseScreen1. This is very helpful to pass the contextual information from one screen to another instead of using the Set() function which makes the variable accessible across all screens.


Hope this helps!


Debajit Dutta
(Business Solutions MVP)