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 / PowerApps Nested Galle...
Power Apps
Answered

PowerApps Nested Galleries

(0) ShareShare
ReportReport
Posted on by

Hello, I'm developing the Nested Gallery in PowerApps. We need to save the data into multiple SharePoint lists.

I have 2 galleries, gallery 1, and gallery 2. inserted gallery2 inside the gallery 1. need to save those data into with respective list1 and list2. how to achieve it? please help. i have tried using the below function, but no luck. only one list is updating another list is not. ForAll(AddressRepeatGallery.AllItems,Concurrent(Patch(SupplierAddressDetails,Defaults(SupplierAddressDetails),{Title:txtAddCity.Text,City:txtAddCountry.Text}),ForAll(siteDetailsGallery.AllItems,Patch(SupplierAddressSiteDetails,Defaults(SupplierAddressSiteDetails),{Title:txtLanguagePref.Text}))))

 

Form.png

 

Thanks,

Likitha

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

    Hi @likitha 

    On a cursory examination of your formulas, I would not use the Concurrent() function.  PowerApps will prevent the formation of a record in the Child table unless there is a record in the Parent table.  This prevents the formation of "orphan" records in the Child table.  Concurrent() allows for both patches to be applied simultaneously.  Create the Parent record first and then patch in the Child record. 

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @likitha ,

    Could you please share a bit more about your scenario?

    Do you want to save Gallery1 items back to your List1, and save nested Gallery2 items back to your List2?

     

    If you want to save Gallery1 items back to your List1, and save nested Gallery2 items back to your List2, I afraid that there is no way to achieve your needs.

     

    Currently, it is an known issue within PowerApps app -- when referencing All Items of a nested Gallery under a parent Gallery in a ForAll function, the nestedGallery.AllItems formula would return empty record.

     

    So the siteDetailsGallery.AllItems formula would return empty record on your side, the nested ForAll formula could not achieve your needs.

     

    As an alternative solution, I think Collection could achieve your needs. I assume that your Gallery1 and Gallery2 are both connected to individual collection (AddressCollection & SiteCollection), is it right? You could consider save your Gallery1 Items and Gallery2 Items into individual collections, the you could apply your ForAll function to these two individual collections.

     

    I have made a test on my side, please consider take a try with the following workaround:

    Add a "Save" icon inside your Gallery1, set the OnSelect property to following:

    Patch(
     AddressCollection,
     ThisItem,
     {
     AddressCountry: AddressCountryTextBox.Text, // replace AddressCountryTextBox with actual Text Input control name in your Gallery1
     City: CityTextBox.Text,
     State: StateTextBox.Text
     }
    )

    When you made changes to corresponding Address Item within your Gallery1, press above "Save" icon to save the changes back to your AddressCollection.

     

    Add a same "Save" icon inside your nested Gallery (Gallery2), set the OnSelect property to following:

    Patch(
     SiteCollection,
     ThisItem,
     {
     Address_Country: Gallery1.Selected.AddressCountryTextBox.Text, // relate the Site Item to the corresponding Address Item
     SiteName: SiteNameTextBox.Text,
     OperationUnit: OperationUnitDropdownBox.Selected.Value,
     LanguagePref: LanguagePrefTextBox.Text,
     StartDate: StartDatePicker.SelectedDate
     }
    )

    when you made changes to Site Item in your nested Gallery, press the "Save" icon to save the corresponding Site Item back to your SiteCollection.

    Note: I assume that you are configuring your Gallery as a Repeating Table

     

    After that, outside the Gallery1, set the OnSelect property of the "Save" button to following:

    ForAll( // patch AddressCollection back to your SupplierAddressDetails List
     AddressCollection,
     Patch(
     SupplierAddressDetails,
     Defaults(SupplierAddressDetails),
     {
     Title: AddressCollection[@AddressCountry],
     City: AddressCollection[@City]
     }
     )
    );
    ForAll( // Patch SiteCollection back to your SupplierAddressSiteDetails List
     SiteCollection,
     Patch(
     SupplierAddressSiteDetails,
     Defaults(SupplierAddressSiteDetails),
     {
     Title: SiteCollection[@LanguagePref],
     'Address Country': SiteCollection[@Address_Country]
     }
     )
    )

    Note: I assume that the 'Address Country' is a Text type column in your SupplierAddressSiteDetails List, which is used to store the corresponding 'Address Country' value. You set up relationship between your SupplierAddressDetails List and SupplierAddressSiteDetails List through this  'Address Country' Text field.

     

    Please take a try with above solution, check if the issue is solved.

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @v-xida-msft ,

     

    Thanks for the detailed explanation. I am using the same approach. Consider I have added 3 child row data (Site details). Then I am clicking the add icon in Parent Row (Address details), now it generates the one new parent row and 3 child rows (because child collection already have 3 rows of data ). It should be one one Child row. How to achieve this.?

     

    Thanks in advance.

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 421 Most Valuable Professional

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard