PowerApps – Passing values between screens

No comments

When a user navigates from screen 1 to the screen 2, we want to render content on screen 2 based on the user’s selection on the screen 1. To do this we have to pass the selected value(s) to screen 2.  Let’s check out how to achieve this in PowerApps.

Download the sample App from here.

In the last post, I talked about Navigate function which takes 3 parameters.

Parameter 1: Name of the screen to be displayed.

Parameter 2: Transition options while navigating between screens. Options available are Cover, Fade and None.

Parameter 3: This is an optional parameter. Using this we can pass variable(s) between screens. The format for this parameter is {ID1:value1,ID2,value2…}. We can pass multiple values between screens.

In the sample app, we want to pass the user’s drop down selection to WOD Details page, and display details of the selected WOD. Select OnChange property of the drop down and notice the following formula:

Navigate(WODDetails, ScreenTransition.Fade, {wod:Dropdown1_1.Selected.Value})

PAContextVariable1

This formula says, navigate to WODDetails page and while transitioning to the screen, fade the old screen to display the new screen. Now the 3rd parameter:  {wod:Dropdown1_1.Selected.Value}

This says associate the selected drop down value with the variable called wod.

In WODDetails screen, wod variable is used to display details of the selected WOD. Select visible property of the text box. Notice the formula: If(“Michael” in wod, true)

PAContextVariable2

This says if “Michael” was the selected in the drop down, then display the text box.

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s