cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
ajennings1
Level 8

Gallery Visibility Issue

I have multiple galleries on one screen. Depending on what the user clicked on the previous screen, that relevant gallery will be the only one visible. I tested this method out using these lines in the 'visible' property of each gallery:

 

(ListBox1.SelectedText.Value = "Table1")

(ListBox1.SelectedText.Value = "Table2")

(ListBox1.SelectedText.Value = "Table3")

etc.

 

This equates to 'true' and the gallery appears. I have to do this now for over 50 galleries so I was then thinking that in order to save repeating code, I could set a variable (tableName) to the ListBox1.SelectedText.Value and just have each visible property like this:

 

(ListBox1.SelectedText.Value = tableName)

 

Only problem now is all galleries are now visible. Is this a bug with PowerApps and variables as the var tableName is exactly the same as typing the listbox selected value as a string? Maybe variables don't work that way in PowerApps but if anyone has any ideas please share.

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Gallery Visibility Issue

@ajennings1 

Not easily in this case because your Visible property will be unique in each control.

BUT...if you DO have a need to change the property of many controls at once, you can select the ones you want and then go to the property and change it.  It will change them in all the controls you have selected.

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Gallery Visibility Issue

@ajennings1 

Your issue is (from what I see) that you are setting the tableName to the ListBox1.SelectedText.Value, and then, you are using the formula for the visible property to compare if the selectedtext in listbox1 is equal to the tableName variable.  Well...it will be, because you set it to be that.  So, all of your formulas will evaluate to 'true'.

 

I believe what you want in your visible formulas is:

   (tableName = "Table1")  etc.

 

Also, you might want to consider changing the usage of SelectedText to Selected as SelectedText has been deprecated.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Super User
Super User

Re: Gallery Visibility Issue

Correct me if I am wrong, but what I understood you to say is that you are setting tableName = List1.Selected.Text.Value, then you are testing in your visible property for List1.Selected.Text.Value= tableName.  If that that is true, you have created a situation which will always evaluate to true because you just set one to the other and then tested the same exact condition you just forced to be equal - hence all your galleries will always display.

 

I don't see an easy way around making an explict test for each gallery, but perhaps someone else can come up with one.  I have done similar when creating dialog boxes within a screen and I have always had to make an explict test.  (Of course, I had not layered 50 of them so it wasn't nearly as onerous, although I did have to check a lot of individual controls in my case)

ajennings1
Level 8

Re: Gallery Visibility Issue

@LRVinNC @RandyHayes,

 

Ok I understand now whoops! There must be another way surely but I'll need to investigate further. It would be great to find a way where i could just CTRL+V into each visible property Smiley Very Happy

 

Thanks.

Super User
Super User

Re: Gallery Visibility Issue

@ajennings1 

Not easily in this case because your Visible property will be unique in each control.

BUT...if you DO have a need to change the property of many controls at once, you can select the ones you want and then go to the property and change it.  It will change them in all the controls you have selected.

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

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,223)