cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Spawn10
Level: Powered On

How do I get to display different gallery depending on data being passed?

I have a page with serveral galleries on it. Depending on the data being displayed in a field from my data source, I want only one gallery to be displayed at a time. So if "Apple" is displayed on my field, I want the gallery that has the product information to be visible aong with all the control within the gallery. However if "Orange" is displayed in my field, i want the gallery that will display the product information about oranges to be visible along with all the controls on the gallery. 

On my page, I am declaring variables, then setting the visibility of the respective gallery, then trying to set an "If" statement to display the gallery (depending on what data I get from the data source".

The "Visible" property, I am setting directly on each gallery. The others (UpdateContext and If statements), are on the page. 

UpdateContext({appleGallery:false});
UpdateContext({orangeGallery:false});
Visible = appleGallery;
Visible = orangeGallery;
If(AppleGallery.Selected.NameOfFruit = "Apple", !appleGallery, appleGallery);
If(AppleGallery.Selected.NameOfFruit = "Orange", !orangeGallery, orangeGallery)

This does not seem to be working. What am I doing wrong, and what is the best way to get this desired result.

 

Thanks for the help.

1 REPLY 1
TopShelf-MSFT
Level 10

Re: How do I get to display different gallery depending on data being passed?

Hi @Spawn10 I'm sorry to hear you're experiencing this issue. I came across a similar post earlier today that may help you. If the below information does help, please reply in this thread and I will research further. 

 

Here is the link to a post that may help: 

https://powerapps.microsoft.com/en-us/blog/one-to-many-relationships-for-canvas-apps/

 

Example: 

For the purposes of this explanation, let's assume the first gallery is named Partners and the second gallery is named Contacts. For the Contacts gallery, try setting the Items to Partners.Selected.<Contacts field> where <Contacts field> is the filed you want to display from the Contacts entity.

 

@TopShelf-MSFT

 

 

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (4,199)