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 multiple items i...
Power Apps
Unanswered

Patch multiple items in Gallery based on conditions

(0) ShareShare
ReportReport
Posted on by 603

I have a below Gallery with SharePoint as the datasource.

 

Need to patch gallery based on the condition where DC_No="DC202303-4" and if Approve button is clicked, Status should get changed to Approved.

 

Currently gallery will return 3 items because there are 3 records with DC_No="DC202303-4". Hence all 3 records status should get changed to Approved. I tried at my end using ForAll but it doesn't work. 

 

Iantaylor2050_0-1681923335690.png

 

Categories:
I have the same question (0)
  • mmollet Profile Picture
    3,187 on at

    ForAll(Gallery.AllItems As temp, Patch(SPListName, temp, {Status: "Approved"})

     

    This will only work if the gallery is filtered already to only show the items you want to approve as you mentioned in your question. If you want to filter them down without doing so in the gallery then you can do the following: 

    ClearCollect(localList, Filter(Gallery.AllItems, DC_No="DC202303-4"))

    ForAll(localList As temp, Patch(SPListName, temp, {Status: "Approved"})

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 325 Most Valuable Professional

#2
11manish Profile Picture

11manish 165

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 88 Super User 2026 Season 1

Last 30 days Overall leaderboard