cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Steve130
Frequent Visitor

Is it possible to reference a parent gallery's item in a nested gallery?

Hello, I'm trying to use nested galleries to create an expandable menu. Each parent menu has an "expand" button with the following OnSelect formula: 

 

If(
CountRows(Filter(Expanded, Value=ThisItem.Object_Identifier)) > 0,
Remove(Expanded, First(Filter(Expanded, Value=ThisItem.Object_Identifier))),
Collect(Expanded, ThisItem.Object_Identifier)
)

Object_Identifier is a unique identifier for each record in the data source. The expand button adds the current item's identifier to a collection called "Expand".

 

The child gallery's height property has the following formula:

 

If(
CountRows(Filter(Expanded, ????)) > 0,
CountRows(Filter('Child Data source', ThisItem.Object_Identifier in ProcessIsUsedToDeliverTheseServices))*32,
0
)

What I'm trying to do here is: if the parent's item's identifier is in the collection, the height of the child gallery is some positive number. Otherwise its 0 (minimized). However, as you can see I can't figure out a way to reference parent item data, hence the ????. There's no Parent.ThisItem. Is there another way I can do this? Thanks.

3 REPLIES 3
Drrickryp
Super User
Super User

@Steve130 

Are you using GroupBy() in the parent gallery?

No, would that help? If it returns the data table in a different order, I'm not sure how it would help me.

Drrickryp
Super User
Super User

@Steve130 

Most of the applications I have seen have used GroupBy and then have expand and contract the subgallery.  Shane Young has a new video that may help you though.  https://www.youtube.com/watch?v=VNnaymeBN7g 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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