web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Access Parent's Galler...
Power Apps
Answered

Access Parent's Gallery Item in a Nested Gallery

(0) ShareShare
ReportReport
Posted on by

I currently have a nested gallery where the nested gallery needs to be aware of the columns of the item of the parent.

 

The structure may look something like this.

The hours text input box will get it's information from a Filter() from another table, where the ID of both the parent item and the child item in the galleries are needed. The parent being the TaskID and the child being the PersonID.

 

gallery.PNG

 

 

Is there something like, ParentItem.ID for galleries because it seems the only thing I can access seems to be Parent.AllItems which is not what is needed.

 

Thanks

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Anonymous 

     

    Yes you can create a nested Gallery inside a Gallery control. There is a limitation though that you cannot have more than 1 nested gallery i.e. allowed only till 2 layers of hierarchy.
     
    For doing so, you can use the Filter query, the only requirement is the attribute you want to nest should be of type table with either single or multiple tables. 
     
    Suppose your Main Gallery has Items, Filter(SPList1,Direction= "North")
     
    and another attribute(location) of this SPList1 is of type table, in the nested gallery you can directly refer the items as: ThisItem.location
     
    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
  • Community Power Platform Member Profile Picture
    on at

    Hi @yashag2255 ,

     

    Thank you for your response, the situation is that I need both the current item in the parent gallery and child gallery to do a filter for a value.

     

    So it would be something like Lookup(Costs, parent=ParentID (from parent item) && child=ChildID).cost
    where the parent is a Task item from the Tasks SPList and child is a person from Person's table for instance.

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    Hi @Anonymous ,

    Can you put a label (lblParentID) on the Gallery in the Parent that has Text:ThisItem.ParentID; and then use the lblParentID in the Lookup on the Child gallery - you can hide this label

    Lookup(Costs, parent = lblParentID && child = ThisItem.ID)

    Regards,

    Andrew

  • Community Power Platform Member Profile Picture
    on at

    Hi @Anonymous,

     

    This was exactly what I was looking for! Thank you so much!

  • dmanoni1 Profile Picture
    24 on at

    Is there any other way?  I can not use this in my situation and honestly this seems like a crap solution.   

  • HEATFreight Profile Picture
    1,024 on at

    It worked for me. What are you trying to do? Gallery indices are weird in PowerApps.

  • TxTechnician Profile Picture
    98 on at

    Add an control in the parent gallery, like an icon, in the parent gallery.  [We will call this "Icon7"]  Set that icon to select the parent item (or better yet, set a variable to this item "Set(_varName,ThisItem)").

     

    Then in the nested gallery set the icon (or whatever control you're using) to "Select(Icon7)".

  • CodeMorgan Profile Picture
    28 on at

    In the Items for the nested gallery item, add a column named "ParentID" as shown below:

    Items = AddColumns( /*Child Collect field in Parent*/ ThisItem.ChildItems, "ParentID", ThisItem.ID)

     

    Then anytime you need to reference the parent ID you can do so with "ThisItem.ParentID" in the nested gallery.

  • gayanku Profile Picture
    2 on at

    An easy solution is simply to use ThisItem

    Lets say you have 2 nested Galleries A and B. A is parent, and B is inside (child)

    To have specific items in B, set  

     items: Filter(collection, X= ThisItem.Y)


    ThisItem.X is taken from the parent (A) and as a result, B will only have the filtered values related to that parent gallery item.

     

    gayanku_0-1714553497669.png

     

  • Commonman Profile Picture
    6 on at

    Thank you. Detailed clarification with the AddColumns( / function deserves the correct answer here. 
    This needs more documentation by MS.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard