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 / Need help in updating ...
Power Apps
Answered

Need help in updating a collection with gallery of record

(0) ShareShare
ReportReport
Posted on by 1,119

Dear Team,

 

1. I am creating a collection from a Sharepoint list with filter. My Formula is :

 

 

ClearCollect(ColKPA2,Filter(AWPR_Responses,KPA_ID="KPA-2",EmpFullName = varReviewUser));

 

 

2. I have gallery in my screen. The item formula given the collection name ColKPA2

3. The gallery records has combo box on each record.

4. I would like to update the collection with combo box value for the gallery records.

 

 

 

ForAll(gal_kpi2.AllItems,
Patch(ColKPA2,LookUp(ColKPA2,ID=ColKPA2[@ID]),{HoDRating:cmb_score_kpi2.Selected.Value}));

 

 

But this give me an error. 

Categories:
  • Rajkumar_M Profile Picture
    3,747 Moderator on at

    Hi @venka91 

     

    Try this

     

    ForAll( gal_kpi2.AllItems, 
    Patch( ColKPA2, LookUp(ColKPA2, ID = ThisItem.ID), { HoDRating: cmb_score_kpi2.Selected.Value } ) )

    Thanks!

     

    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation. 

  • cdwhite Profile Picture
    1,069 Most Valuable Professional on at

    What value in your collection are you trying to update? If it’s an existing column, you could add some code to the OnChange property of your combo box to perform the updates real-time, using something like:

     

    UpdateIf(colKPA2, ID=ThisItem.ID, {FieldName: Self.Selected.Value})

     

    ------------------------------------------------------------------------------------------------------------------------------
    If I've answered your question, please mark your post as Solved. You can accept more than one post as a solution.

    If my response was a good one, please give it a Thumbs Up!

    Visit my blog: https://platformsofpower.net

     

  • venka91 Profile Picture
    1,119 on at

    I want to use the Patch outside gallery. Pls suggest

  • Verified answer
    cdwhite Profile Picture
    1,069 Most Valuable Professional on at

    That’s fine, I’d personally use the OnChange method on your combo box in the gallery, then have a button outside of the gallery to do your Patch, like so:

     

    Patch(datasource, colKPA2)

     

    the collection you’re building matches the data source schema, so if the updates to the collection are done real-time then the Patch function easily works as per the above.

  • venka91 Profile Picture
    1,119 on at

    But, i have caught up with one more problem, the gallery has a combo box and a text for comments. the Onchange of combo box is updates the value, but my text box input values left alone. Any way how would i accomdate this two ? That is the reason, i want to update the collection with the button outside gallery with the records shows on gallery.

  • Verified answer
    cdwhite Profile Picture
    1,069 Most Valuable Professional on at

    Hello @venka91 ,

    Is there a field in your data source store the comments too? If so, you can apply the same logic to the OnChange property of your text box, using the same UpdateIf method I outlined above. As that would update the underlying collection, it would be included by default when patching the collection back to the data source.

    The only added thing with Text Input controls though, if you're going to do that method then also set the DelayOutput property to true. This means the UpdateIf won't run on every single keystroke, it'll delay until you or the user have finished typing. You'd also need to update the Default property of the Text Input control to ThisItem.CommentsField.

    ------------------------------------------------------------------------------------------------------------------------------
    If I've answered your question, please mark your post as Solved. You can accept more than one post as a solution.

    If my response was a good one, please give it a Thumbs Up!

    Visit my blog: https://platformsofpower.net

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 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard