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 / Bulk update collection...
Power Apps
Unanswered

Bulk update collection from gallery with individual inputs

(0) ShareShare
ReportReport
Posted on by 70

Hi guys,

I'm trying to find a way to update a collection of items that have matching ID's to items I'm managing in a gallery.

The issue is the gallery rows have inputs with information I'm wanting to capture and I can't seem to reference those specifically.

I'd ideally like to do this in one function like seen below but I hit a brick wall with referencing the inputs.

ForAll(
 Filter(
 Gal.AllItems,
 ThisRecord.Checkbox.Value = true
 ),
 UpdateIf(
 Collection,
 ID = ThisRecord.ID,
 {
 Value1: ThisRecord.Dropdown1.SelectedText.Value,
 Value2: ThisRecord.Dropdown2.SelectedText.Value
 }
 )
)

 
Below is my current solution working, I'd rather not create a temp collection to make it work though if possible.

ForAll(
 Filter(
 Gal.AllItems,
 ThisRecord.Checkbox.Value = true
 ),
 Collect(
 TempCollection,
 {
 TempID: ThisRecord.ID,
 TempValue1: ThisRecord.Dropdown1.SelectedText.Value,
 TempValue2: ThisRecord.Dropdown2.SelectedText.Value
 }
 )
);
ForAll(
 TempCollection,
 UpdateIf(
 Collection,
 ID= TempID,
 {
 Value1: TempValue1,
 Value2: TempValue2
 }
 )
);
Clear(TempCollection)

 

Any ideas?

I've done some tested, checked other posts (maybe I missed a relevant one) and asked copilot for ideas.

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    155,444 Most Valuable Professional on at

    Hi @ShannonC ,

    This should work - if you do not want the ID in the collection, just leave it out

    ClearCollect(
     Collection,
     ForAll(
     Filter(
     Gal.AllItems,
     Checkbox.Value
     ) As _Data,
     {
     ID: _Data.ID,
     Value1: _Data.Dropdown1.Selected.Value,
     Value2: _Data.Dropdown2.Selected.Value
     }
     )
    );

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • ShannonC Profile Picture
    70 on at

    Hi Warren, I've tested this. This replaces the record instead of updating causing other values in the collection to be lost. I don't consider it a good solution.

  • anandm08 Profile Picture
    1,936 Super User 2024 Season 2 on at

    hi @ShannonC ,

    try this:

    ForAll(
     Filter(
     Gal.AllItems,
     ThisRecord.Checkbox.Value = true
     ),
     Patch(
     Collection,
     LookUp(Collection, ID = ThisRecord.ID),
     {
     Value1: ThisRecord.Dropdown1.SelectedText.Value,
     Value2: ThisRecord.Dropdown2.SelectedText.Value
     }
     )
    )
  • ShannonC Profile Picture
    70 on at

    You'd think this one would work but it only updates the first record and none of the others.

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 842

#2
Valantis Profile Picture

Valantis 563

#3
Haque Profile Picture

Haque 402

Last 30 days Overall leaderboard