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 / Patching multiple reco...
Power Apps
Answered

Patching multiple records contained in a nested gallery

(0) ShareShare
ReportReport
Posted on by 6

Hey everyone

 

I'm new to PowerApps and I'm facing an issue that I can't seem to solve. I'm building a PowerApp that contains a nested gallery of records that are derived from a SharePoint list. Here are some relevant screenshots of my application:

 

pr3mrxj_1-1695193611900.png

pr3mrxj_2-1695193804637.png

 

The following is my code contained in the OnSelect property of the Save button (Button_Sample_22):

ForAll(Gallery3_3.AllItems As aPatch,
 ForAll(Gallery6_3.AllItems As bPatch,
 Patch(
 Qualifications,
 Defaults(Qualifications),
 {
 Title: aPatch.Title2_6.Text,
 Subcategory: bPatch.Subtitle5_6.Text,
 Skills: bPatch.Subtitle5_7.Text,
 Score: bPatch.Dropdown_Sample_4.SelectedText.Value
 }
 )
 )
);

 

Expected behavior: Patches all the records inside the gallery into the connected SharePoint list (Qualifications).

Current behavior: Does nothing.

 

Here is a screenshot from the PowerApps monitor for the application:

pr3mrxj_3-1695194006919.png

pr3mrxj_4-1695194018277.png

According to the logs, the ForAll loop is being executed, but does not return a valid result, i.e. does not reflect the changes inside the application to the SharePoint list. Any idea on how to fix this?

Categories:
I have the same question (0)
  • Verified answer
    Chris-D Profile Picture
    1,246 on at

    Hi @pr3mrxj, I answered this question for someone else a couple of weeks ago. I can't fault your approach and I have tested the same but for some reason I can't pull values out of a nested gallery's AllItems. Everything seems blank. 

     

    I've not had time to investigate/try and fix this yet but my approach that worked was to create a list of changes and patch that instead. 

     

    Code on the OnChange event of control for a text input:

    // See if we already have a change record for this item
    If( IsBlank( LookUp( GalleryChanges, ID = ThisItem.ID)),
    
     // If we don't, create a record
     Collect( GalleryChanges, Penguins@{
     ID: ThisItem.ID,
     Notes: Self.Text
     }),
    
     // If a record exists, update it with this change
     Patch( GalleryChanges,
     LookUp( GalleryChanges, ID = ThisItem.ID), 
     {
     Notes: Self.Text
     }
     );
    )

     

    Then to update the changes:

    Patch( DataSource, ShowColumns( GalleryChanges, "ID", "Notes"));

     

  • pr3mrxj Profile Picture
    6 on at

    Hi @Chris-D 

     

    Thanks for your response, much appreciated. Can I apply the same code to the OnChange event of a dropdown control perhaps? Sorry if my question seems a bit redundant, but I just need to make sure of everything before trying out an approach.

  • Chris-D Profile Picture
    1,246 on at

    Yes the same code should work for any control. Using the code you originally posted, you'd need to use Self.SelectedText.Value in your Dropdown_Sample_4 dropdown.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 846

#2
Valantis Profile Picture

Valantis 532

#3
Haque Profile Picture

Haque 410

Last 30 days Overall leaderboard