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 / Updating a Collection,...
Power Apps
Answered

Updating a Collection, then doing a Patch - value not updating OnChange

(0) ShareShare
ReportReport
Posted on by

Hi

I found a bug in my App that I just can't debug/fix. I thought it was all working fine until someone mentioned that a score didn't add up.

In the App I have a Gallery-style form capturing scores as a collection (updating when a change is made to the values) Everything works fine except for this specific use case

 

I have done a little video

Powerapp collection (1).gif

 

Basically, if I update the dropdown the corresponding score for that is collected and added to a total.

The collection is updating the dropdown.value & the total - as you can see, the scores next to each dropdown update & the total is updated.

However, in the video you can see the Collection in realtime - the total in there, which references the total in the SPlist does not update as expected

 

Some of the update statement for the collection is below 'Trust alignment Alignment' is a text field in my SPlist

UpdateIf(
 colTriageDetails,
 ID = ThisItem.ID,
 {
 'Request ID': varCurrentRecord.'Request ID',
 'Request Name': varCurrentRecord.Title,
 Summary: txtSummary_1.Text,
 
 'Advancing Our Digital Capability': dpdDigitalCapability.SelectedText,
 'Collaborating With Our Partners': dpdCollaborating.SelectedText,
 'Improving Quality For Patients': dpdImprovingQuality.SelectedText,
 'Making Our Money Work': dpdMakemoneywork.SelectedText,
 'Supporting Our People': dpdSupportourpeople.SelectedText,
 'Transforming Our Services': dpdTransform.SelectedText,
 'Trust Strategy Alignment (out of 60)': txtTrustTotal_1.Text,

Then the patch (on a save button) is

Patch(
 'Request Assessment',
 ShowColumns(
 colTriageDetails,
 "Title",
 "Request_x0020_Name",
 "Summary",
 
 "Advancing_x0020_Our_x0020_Digita",
 "Collaborating_x0020_With_x0020_O",
 "Improving_x0020_Quality_x0020_Fo",
 "Making_x0020_Our_x0020_Money_x00",
 "Supporting_x0020_Our_x0020_Peopl",
 "Transforming_x0020_Our_x0020_Ser",
 "Trust_x0020_Strategy_x0020_Align",

All the other fields update fine, I just can't get this one to be the same as the actual Sum of the scores

 

Might be tricky to fix I know but I really can't work out what is wrong

Thanks

Steven

 

Categories:
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @steshepherd ,

     

    Do you mean the collection won't get updated when changing selections in the Dropdown? Is the UpdateIf function in the OnChange property?

     

    Best regards,

  • Verified answer
    steshepherd Profile Picture
    on at

    Fresh eyes this morning - I worked out it was to do with the Onchange for the textbox that was storing the total value. It wasn't firing the onchange immediately, so I took a lead from this video on YT and used a slider to force the onchange

    https://www.youtube.com/watch?v=kzIv6kNuzJ4 

     

    The onchange property selects a button - the button onselect property has the updateif statement in it.

     

    Seems to be updating as I hoped!

    Thanks

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

#2
WarrenBelz Profile Picture

WarrenBelz 191 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 167

Last 30 days Overall leaderboard