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 won't update fro...
Power Apps
Answered

Patch won't update from collection

(0) ShareShare
ReportReport
Posted on by 60

Hi. I'm trying to update my Sharepoint list (Inventory) from a collection (CheckedRows). The column I want to update is a checkbox column and is called Location Verified. The collection, CheckedRows, has two columns: Location Verified and Title (which is the column 'Asset ID' in the SharePoint list).

I have a gallery with a checkbox. If the checkboxes are ticked, the record shows up in the collection as 'true', as well as the Asset ID in the 'Title' column.

The SharePoint list has a column called 'Location Verified' which are all checked to start with.

In my PowerApp, I click a button that deselects all the checkboxes. I then re-check all the items that are in the location they're supposed to be in.

What I want is, when I click a 'Submit' button, for the records with unticked boxes to update in the SharePoint list to 'false'.

On the Submit buttons OnSelect, I've tried lots of different things. But the simplest is: Patch(Inventory, CheckedRows).

However, when I run this, I get a big long error message which basically says that it can't patch because 'Asset ID' (the Title column) has duplicate records.

This sounds like it's trying to add records rather than update them. I've tried lots of different suggestions from the internet. What am I doing wrong? Why isn't it updating the existing records?

Screenshot 2022-07-08 at 23.53.24.png
Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @reinwood 

    You can skip all the collections as you don't need them.

    Consider changing your formula to the following:

    Patch(Inventory,
     ForAll(
     Filter(yourGallery.AllItems, !yourCheckBox.Value),
     {ID: ID,
     'Location Verified': false
     }
     )
    )

     

    That will change the column you are interested in changing in the Inventory list based on the unchecked items in the gallery.

     

    I hope this is helpful for you.

  • reinwood Profile Picture
    60 on at

    Thanks - that worked exactly as I wanted it to!

     

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 271

#3
Mohsin Ali Profile Picture

Mohsin Ali 223

Last 30 days Overall leaderboard