cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RobRoy
Helper III
Helper III

Navigate from copied Gallery Heading appears linked

Hello,

 

I copied my starting BrowseGallery1 sheet to a new sheet so that I could create a new search parameter with the same layout. The filtering and sorting works fine, but when I click on a record in the copied Gallery list (BrowseGallery1_1) it does not take me to that record's DetailScreen, but to whatever record was chosen in the first BrowseGallery. Is there something linking the two Galleries together? The data fields for both screens Headings are the same (EventDate), and the code for both seems pretty simple:

 

Navigate(DetailScreen1, ScreenTransition.None)

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
mr-dang
Community Champion
Community Champion

The DetailForm on your DetailScreen is likely tied to BrowseGallery1.Selected in its Item property.

 

If you want it to handle content from either BrowseGallery, then you would need to use a Context Variable and a conditon:

 

  1. Add a context variable to the Navigate formula:
    For BrowseGallery1:
    Navigate(DetailScreen1, None, {formcode: 1})
    
    For BrowseGallery2:
    Navigate(DetailScreen1, None, {formcode: 2})
  2. Change the default item for DetailForm using a condition:
    If(formcode=1,
    	BrowseGallery1.Selected,
    	formcode=2,
    	BrowseGallery1_1.Selected
    )
    This means, "Show details for the record selected in BrowseGallery1 if formcode is 1. Otherwise if formcode is 2, then show the record selected in BrowseGallery1_1."

 

 

Microsoft Employee
@8bitclassroom

View solution in original post

4 REPLIES 4
mr-dang
Community Champion
Community Champion

The DetailForm on your DetailScreen is likely tied to BrowseGallery1.Selected in its Item property.

 

If you want it to handle content from either BrowseGallery, then you would need to use a Context Variable and a conditon:

 

  1. Add a context variable to the Navigate formula:
    For BrowseGallery1:
    Navigate(DetailScreen1, None, {formcode: 1})
    
    For BrowseGallery2:
    Navigate(DetailScreen1, None, {formcode: 2})
  2. Change the default item for DetailForm using a condition:
    If(formcode=1,
    	BrowseGallery1.Selected,
    	formcode=2,
    	BrowseGallery1_1.Selected
    )
    This means, "Show details for the record selected in BrowseGallery1 if formcode is 1. Otherwise if formcode is 2, then show the record selected in BrowseGallery1_1."

 

 

Microsoft Employee
@8bitclassroom

View solution in original post

v-micsh-msft
Community Support
Community Support

Adding some additional information for reference:

Understand data forms in Microsoft PowerApps

Edit form and Display form controls in PowerApps

Regards

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you, that worked exactly as planned. I'll have to remember that one, as I have several other search galleries planned.

 

Question: Is "formcode" some user-generated variable, something a user can create on the fly as they need it?

mr-dang
Community Champion
Community Champion

@RobRoy wrote:

Question: Is "formcode" some user-generated variable, something a user can create on the fly as they need it?


@RobRoy,

You are correct. formcode is a user-generated context variable. Normally you would use UpdateContext() to name variables, but those variables are only accessible on the Screen they were created on. If you want a variable to travel to another screen, then you would place it in the third argument of Navigate():

Navigate(screen,transition,{variablename: value})

So you could rename formcode whatever you want.

Microsoft Employee
@8bitclassroom

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,733)