Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
551 views
in Technique[技术] by (71.8m points)

powerapps - Pass a value to another screen

I have a screen where the user can select an option (not a browse gallery as it does not do what is required).

I want to pass the item the user has selected to the pre-made "DetailScreen1" which is used by the browse gallery.

I looked at the browse screen but did not see how it does it as the navigate onselect event is just normal navigation.

Code:

Navigate(DetailScreen1, ScreenTransition.Fade)

I want to do something like

Navigate(DetailScreen1, ScreenTransition.None {Last(listOfStuff)})

Thanks

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can use the third parameter of the Navigate function to pass extra parameters to the context of the screen being navigated to. For example, if your first screen has a dropdown and a text input control that you want to pass the values to the next screen, you can use the following expression:

Navigate(DetailScreen1, ScreenTransition.Fade, { text: TextInput1.Value, dropdownChoice: Dropdown1.Selected.Value })

In the DetailScreen1, you can use those context variables as they'll be available.

Here's an example: the dropdown in the first screen contains a list of sections, and after selecting one you would navigate to another page:

Sample result

In the "right arrow", we can set the following OnSelect property:

Navigate(ProductsScreen, ScreenTransition.Fade, { selectedSection: Dropdown1.Selected.Value })

In the ProductsScreen, you can then have a gallery whose items are filtered based on that value that was passed:

Items: Filter(AllProducts, Section = selectedSection)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...