cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Skilled Sharer
Skilled Sharer

Re: Expansion/accordion with a gallery

@Hockeyman9474
Sorry I didn't realise I have put the formulas twice for the collapse button, I have now edited the answer.

So the basic understanding behind all these steps is that a button will be visible when the other one is not - which is achieved by using the "Not" for one of the buttons, based on the current state of the gallery - so if the gallery is expanded then the collapse button is shown and the other way around, when the gallery is collapsed the collapse button is shown.
The gallery state is determined by the 'expandCollapse' variable which when set to true means the gallery is expanded and when is false the gallery is collapsed. This variable can be named anything - is you who creates it and who updates it. 
The ThisItem.IsSelected ensures that the item that has been selected is the one who expands/collapse, otherwise when clicking on one of the items, all the rest will expand/collapse - the 'expandCollapse' value being set on all of them.

Hope this helps 🙂


MelindaK
Highlighted
Helper III
Helper III

Re: Expansion/accordion with a gallery

OK so now it works, I need some theory help and then I'll leave you alone. Teh atatched doc shows gallery 2 open showing dealers in district 1. i need anotehr set of expand/collapse arrows next to each dealer that will show sales data. Obviously you have armed me with the tools to create these arrows, but I can't figure out how to insert them so they appear next to each dealer. Another possibility is to hyperlink the dealer name to achieve similar results when the user clicks on it. I attempted to explain to my IT manager that there isn't anough real estate. Any suggestions there?

Highlighted
Skilled Sharer
Skilled Sharer

Re: Expansion/accordion with a gallery

Not fully sure I understand your needs...

If you only want to add a arrow next to the label with the dealer name is as easy as it was to add the label there, just click on the label, minimize its width so that you have space for the arrow, and simply insert the arrow (or any other icon you need):

e.png

MelindaK
Highlighted
Helper III
Helper III

Re: Expansion/accordion with a gallery

I am trying to add gallery 3 into gallery 2 much like gallery 2 is a sub gallery of gallery 1 so that the second set of arrows will expand/collapse galllery 3. The task given to me was to create a screen where I can expand district to reveal dealers, and then expand each dealer to reveal sales data, and then select that dealer to naviaget to another screen that shows more detailed sales information. As you can see from screenshot, I was able to add the arrows that to expand the dealer but I can't figure out how to insert another gallery. I t would be great if I was able to click and drag one inside the other on the left. SI this even possible?

Highlighted
Skilled Sharer
Skilled Sharer

Re: Expansion/accordion with a gallery

To be honest I don't think is possible to have more than 2 nested galleries, I have tried to add a third gallery inside the second one and it automatically moves it as a new gallery:
gal.png

 

If anyone else knows how to do that, I'd be curious to find out as well. 

Otherwise I think your solution is to only show 2 galleries on the first screen, then move to a next screen where to show another gallery with the sales data of the dealer selected in the previous screen, and then the screen with the more detailed view. 

MelindaK
Highlighted
Helper III
Helper III

Re: Expansion/accordion with a gallery

I opened a new app and without filtering the item just tried nesting galleries: Fixed Height galleries nested in each other, standard galleries nested in each other, fixed height inside standard inside fixed heights, so on and so forth, and I can't do it.  Major limitation when it comes to an accordian design like I am attempting. Has no one else ever attempted this?

Highlighted
Helper III
Helper III

Re: Expansion/accordion with a gallery

OK everything works great and I was going to resolve this thread but 2 additional questions arose:

1. I have a screen with 3 galleries. One filters dealer, another filters district and the third filters region. I added expand and collapse arrows to each, but they work in unison. When I trigger one collapse they all collapse and vice versa. How do I chnage the code to break them apart?

 

2.Is there a way to push a gallery doen when another is expanded or just expand over it and cover it up?

Highlighted
Skilled Sharer
Skilled Sharer

Re: Expansion/accordion with a gallery

@Hockeyman9474, to answer your first question, I believe you need to use different variables for each gallery arrows... so you will have 3 variables expandCollapse - for example - expandCollapseDealer, expandCollapseDistrict and expandCollapseRegion.

 

However, I do not know how to answer your second question...

MelindaK

View solution in original post

Highlighted
Helper I
Helper I

Re: Expansion/accordion with a gallery

For your second question you can declare variable to set the height of the gallery. and u can update this variable when you click on the expansion icon.

Highlighted
Anonymous
Not applicable

Re: Expansion/accordion with a gallery

New to Power Apps so forgive me if this is a really rookie question. Im trying to build an accordion with 4 layers. 4 Different Text Headers and 4 Different text Contents. A Basic accordion so I can arrow down and expand and show text contents or arrow up to un-show that content. The example shows the 4 headers but they are all linked together as one. I tried copying the galleries and renaming and changing but Im feeling thats the wrong route. 

 

If anyone can help a powerapps rookie I'll buy you a beer or 3 at Ignite.

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (3,441)