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 / Patch(update) selected...
Power Apps
Unanswered

Patch(update) selected records to SP list updates all records

(0) ShareShare
ReportReport
Posted on by 820

Hi

I have a gallery and inside a gallery there are a lot of containers in order to make app responsive. 

I have a checkbox and i want to patch(update) my checked gallery items with some info that user will input into another container controls. When i execute a patch my all records(not only the selected ones) are getting updated with same info. I do know this is something against gallery and containers. This is my patch:

 

Patch(Užsakymai,
ForAll(
Filter(GalUzsakymai.AllItems,Checkbox1.Value) As _item,

{
ID:_item.ID,

ReisoID:varReisoID,

Kaina:Value(inpPopupKaina.Text)

}
)
);

It seems due to containers it can not find what to patch? How do i solve it?

Categories:
  • mmollet Profile Picture
    3,187 on at

    Here is an example that I just tested using the As operator: 

     

    ClearCollect(localTest, Gallery1.AllItems); -> This is linked to a SP List called Test I use to answer questions on here
    ForAll(localTest As testarooni, Patch(Test, testarooni, {Age: 30}));

     

    This is saying for all rows in localTest, make the current item be called testarooni and then patch it to Test with Age: 30 as the update. This updates all ages to 30. If I only wanted males then I would filter my list using the gallery and then rerun the code and it would only change males ages to 30 etc. 

     

    ClearCollect(localTest, Filter(Test, Sex: "Male")); -> filter only males
    ForAll(localTest As testarooni, Patch(Test, testarooni, {Age: 30})); -> change their ages

  • julijazas Profile Picture
    820 on at

    @mmollet 

    You want to say i need to use collection if i want to update with patch? Did you put your data inside gallery or as in my case in containers?

  • mmollet Profile Picture
    3,187 on at

    Mine is in a gallery. I have never needed to use a container for any app so far so not sure on how they work

     

  • julijazas Profile Picture
    820 on at

    I found out if i create a referenced another checkbox and put it inside gallery then it works.

    Bloody containers drive me crazy....

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard