cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Passing Button Control to Dropdown on Another Screen?

Currently, I have a HomeScreen, with a network diagram of buttons which control a dropdown, The OnSelect for each button is set to:

 

Reset(Dropdown1);UpdateContext({varNavigate:"RecordName"});Navigate(DetailsScreen, Transition.None)

 

This successfully changes the dropdown to the desired item, then navigates to the DetailsScreen with all the correct record details as indicated as the "RecordName" in the button.

 

The DetailsScreen has a home button, to navigate back to the HomeScreen. 

 

I'd like to have the dropdown on the DetailsScreen, not the HomeScreen for quick navigation between records, but when I put the dropdown on the DetailsScreen, the button no longer controls the dropdown. This is something I'm not sure how to do, passing the button control to the dropdown on another screen. What am I missing in the formula to make this happen?

2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Helper II
Helper II

Finally, just kept flipping the expressions around.

 

Reset(Dropdown1);UpdateContext({varNavigate:"RecordName"});Navigate(DetailsScreen, Transition.None)

View solution in original post

Highlighted

FYI, there is no need for an extra UpdateContext() in your last statement.  The Navigate() function has an optional third element for creating a context variable and carrying it to the target screen.

ResetDropdown1);(Navigate(DetailsScreen, Transition.None,{varNavigate:"RecordName"})

is valid.

 

View solution in original post

6 REPLIES 6
Highlighted
Helper II
Helper II

Based on other forums, I tried the formula:

 

Reset(Dropdown1);Set(varNavigate,"IAD 111");Navigate(DetailsScreen, Transition.None)

 

But the Set function errors with "incompatible type"

Highlighted
Super User III
Super User III

Hi @dsgnmind 

The problem is that you used a context variable to navigate to the Details screen.  Context variables are only valid for the screen that they are created on.  If you use the Set() function, you will create a Global variable that exists throughout the whole app.  The only difference between the two is that the Set() function uses a comma instead of a colon and does not require curly braces.  Set(varNavigate, "RecordName") is the same as UpdateContext({varNavigate:"RecordName"}) but varNavigate can be used everywhere in the app.  One of the reasons for it to be incompatible is if the same variable name is used in an context variable and a global variable in the same app, PowerApps gets confused and pops an error message.  If the context variable worked for you then the global variable HAS to work the same way. 

Highlighted
Helper II
Helper II

Finally, just kept flipping the expressions around.

 

Reset(Dropdown1);UpdateContext({varNavigate:"RecordName"});Navigate(DetailsScreen, Transition.None)

View solution in original post

Highlighted

FYI there is no reason to have an extra UpdateContext() statement.   The Navigate() function includes a way to create a context variable as the third and optional element.  Reset(Dropdown1); Navigate(DetailsScreen, Transition.None,{varNavigate:"RecordName"}) is a valid navigation command and it carries the context variable to the target screen. 

Highlighted

FYI, there is no need for an extra UpdateContext() in your last statement.  The Navigate() function has an optional third element for creating a context variable and carrying it to the target screen.

ResetDropdown1);(Navigate(DetailsScreen, Transition.None,{varNavigate:"RecordName"})

is valid.

 

View solution in original post

Highlighted

Woops! Wrong paste!

 

This is the successful function used:

 

Reset(Dropdown1);Navigate(DetailsScreen, Transition.None,{varNavigate:"RecordName"})

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,059)