Hi experts!
I have 2 gallery in my powerapps. By default, gallery A will be displayed to user when they are directed to the screen. When they click any options in Gallery A, the Gallery A will become invisible and Gallery B will become visible and display certain items based on option selected in Gallery A, and it is at the same position as Gallery A just now. How to do that? As for now, what i did was:
GalleryB.Visible --> GalleryA.Visible = false
GalleryA.OnSelect --> GalleryB.Visible
but it has errors on GalleryA.OnSelect.
Please help!
Solved! Go to Solution.
Hi @_kikilalaaa ,
I did a simple test for you.
1\ Set the OnSelect property of ‘Gallery1’ control to:
Set(Thevar,!Thevar)
Set the Visible property of ‘Gallery1’ control to:
Thevar
2\ Set the OnSelect property of ‘Gallery2’ control to:
Set(Thevar,!Thevar)
Set the Visible property of ‘Gallery2’ control to:
Thevar
3\ The result is as follows:
Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.
You would use UpdateContext() to create a variable when the option is selected.
UpdateContext({var:false})
in the OnVisible property of the screen.
in the control that selects an option (say a checkbox), the OnCheck property would be
UpdateContext({var:true})
You would set the Visible property of GalleryA to !var and the Visible property of GalleryB to var
To toggle between the galleries, you could put the icon with up and down arrows and make its OnSelect property
UpdateContext({var:!var})
Hi @Drrickryp , I have tried your solution.
1. My gallery A property are as follow:
Gallery A. Visible = varvisible
Gallery A. OnSelect = UpdateContext({varvisible:false})
GalleryB. Visible = !varvisible
However, when I run and select anything from Gallery A, Gallery A does not disappear, and Gallery B does not appear.
For your information, my gallery is a vey simple gallery that display items from SharePoint List. My gallery A looks like this :
Try putting the UpdateContext({varvisible:false}) in the OnSelect property of the ">" icon in GalleryA instead of in the OnSelect property of the gallery itself. Also to troubleshoot, put a button on the screen outside either gallery and make its Onselect property UpdateContext({varvisible:!varvisible}) and click it a few times to see what happens.
Hi, I have tried your solution. It seems like the Gallery A doesnt works out when it is selected. Because when I select at the ">" icon, I still cannot go to Gallery B because the varvisible still true.
I have used button and label to check. It works perfectly when I clicked the button. where things could go wrong hmm
Hi @_kikilalaaa ,
I did a simple test for you.
1\ Set the OnSelect property of ‘Gallery1’ control to:
Set(Thevar,!Thevar)
Set the Visible property of ‘Gallery1’ control to:
Thevar
2\ Set the OnSelect property of ‘Gallery2’ control to:
Set(Thevar,!Thevar)
Set the Visible property of ‘Gallery2’ control to:
Thevar
3\ The result is as follows:
Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.