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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Show edit form items b...
Power Apps
Answered

Show edit form items based on gallery selection that is based from another related list

(0) ShareShare
ReportReport
Posted on by 2

I feel like this should be simple but I haven't figured it out yet and figured I'd ask all you experts. 

 

I have one gallery populated from my "Main" list.  That has an ID column that relates to all my other sharepoint lists (TCID=TCID on them all).  I have an edit form that should be updated based on the ID selected in the main gallery.  this isn't a problem for the forms that are from the "Main" list, what I can't figure out is how to populate the items from a related list using the selected ID from the Main gallery.  I don't want to add another gallery using the secondary list if I can avoid it (not all TCID's are on the related table).

 

When I am updating items from the Main list using the main gallery there is no issue: 

DataSource: MainList

ITEM: MainList_Gallery.Selected

 

what I can't figure out: 

DataSource: Detail List

Item: ?????

ID to detail issue on form 1.jpg
Categories:
I have the same question (0)
  • Verified answer
    MudassarSZ365 Profile Picture
    591 on at

    Hi @BLJohnson ,

    Here’s how you can set up your item property for the form that is connected to the 'Detail List':

    LookUp(DetailList, TCID = MainList_Gallery.Selected.TCID)

    Or, if you expect multiple related items and want to edit them, you can set up your form to handle a collection or table. In this case, you would first collect the related items into a collection using the OnSelect property of the gallery or another event. For example:

    // This would be in the OnSelect of the Gallery item or another event
    ClearCollect(RelatedDetailItems, Filter(DetailList, TCID = MainList_Gallery.Selected.TCID))

    Then, you would bind this collection to the form. If the form is expecting a single item, you would need to handle navigation through the collection items (for example, editing the first item, having next/previous buttons, etc.).

    For the 'Item' property of the form that will be editing the 'Detail List' data:

    // If you have a single form and want to edit the first related item
    First(RelatedDetailItems)

    Or, if you have multiple forms for multiple items:

    // If you have multiple forms for multiple items
    // and you set a variable CurrentItemIndex to navigate through them
    RelatedDetailItems[CurrentItemIndex]

    Make sure that after making changes in the form, you handle the save appropriately, updating the 'Detail List' with the changes made.

    If the 'Detail List' can have multiple related records for a single 'Main' list item, and you want to edit them all, you would typically have a gallery to display these related records and then an edit form that would show the details of the selected record from this secondary gallery.

    However, since you want to avoid an additional gallery for the secondary list, you would need to manage navigation through the related 'Detail List' items manually (as shown with the CurrentItemIndex example above), or only edit the first related item.


    This will look up the tab in the collection where the TabId matches the CurrentTabId.

    Kindly mark the solution as accepted if it resolves your issue.

    Best Regards
    Muhammad Mudassar Mazhar

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 366 Most Valuable Professional

#2
11manish Profile Picture

11manish 184

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 99 Super User 2026 Season 1

Last 30 days Overall leaderboard