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 / Bulk Patch to Datavers...
Power Apps
Unanswered

Bulk Patch to Dataverse is updating all records, how to update just the ones modified?

(0) ShareShare
ReportReport
Posted on by 31

Hey, 

 

I have a gallery that updates a Collection every time I change a value, and I have a button (Submit button) that Patches all the data to a Dataverse table.

The problem is that, when I click the Submit button to patch the data, it updates all the columns in Dataverse, changing the 'Modified on' and 'Modified by' columns.

 

This is the event that updates the Collection:

 

 

If(
 ThisItem.'#001_UserList_Project1' in col_UserUpdates.'#001_UserList_Project1',
 Update(
 col_UserUpdates,
 LookUp(
 col_UserUpdates,
 '#001_UserList_Project1' = ThisItem.'#001_UserList_Project1'
 ),
 {
 Country: If(drp_Country.Selected.Value <> Blank(), drp_Country.Selected.Value, ThisItem.Country),
 FullName: If(txt_FullName.Text <> Blank(), txt_FullName.Text, ThisItem.FullName),
 StartDate: If(dte_StartDate.SelectedDate <> Blank(), dte_StartDate.SelectedDate, ThisItem.StartDate),
 Notes: If(txt_Notes.Text <> Blank(), txt_Notes.Text, ThisItem.Notes),
 '#001_UserList_Project1': ThisItem.'#001_UserList_Project1'
 }
 ),
 Collect(
 col_UserUpdates,
 {
 Country: drp_Country.Selected.Value,
 FullName: txt_FullName.Text,
 StartDate: dte_StartDate.SelectedDate,
 Notes: txt_Notes.Text,
 '#001_UserList_Project1': ThisItem.'#001_UserList_Project1'
 }
 )
)

 

 

And this is the Submit button code:

 

 

Patch(
 '#001_UserList_Project1',
 col_UserUpdates
);
ClearCollect(
 col_UserUpdates,
 '#001_UserList_Project1',
);
Notify(
 "Records saved!",
 NotificationType.Success,
 2000
)

 

 

Does any one know, how to bulk update but at the same time just Patch the items modified?

Categories:
  • bengo83 Profile Picture
    159 on at

    Hi @wezhema 

     

    I assume you have an id column in the dataverse table. If you don't have any one you can use another field for the LookUp. 

     

    You can use this code for the submit button:

    Patch(
     '#001_UserList_Project1',
     LookUp('#001_UserList_Project1',ID = YourGallery.Selected.ID),
     Gallery.Selected
    );

     

    On this way you only patch the selected row from the gallery to dataverse.

     

    I hope it helps 🙂

     

    Best regards

    Beny

     

  • wezhema Profile Picture
    31 on at

    Hi Beny,

     

    Thank you for your response, the thing is that I am bulk editing an Editable Grid, like in this video:
    https://youtu.be/vRn7br2OaxE?t=2037

     

    I am not editing just a single item, so when I hit 'Submit' it is updating all the rows in Dataverse

  • bengo83 Profile Picture
    159 on at

    Hi @wezhema 

    Great, thanks for the clarification 🙂 The colums 'Modified on' and 'Modified by' are always updated, even if you only one value update in a row. As far i know there is no way to avoid this.

     

    The formula to update just several columns in a table is:

     

    ForAll(
     YourTable, // Replace this with the name of your table
     Patch(
     '[dbo].[YourTable]',
     LookUp('[dbo].[YourTable]', PrimaryKeyField = YourTable[@PrimaryKeyField]), 
     {
     YourField: YourTable[@YourField
     }
     )
    )

     

    Best Regards

    Beny

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard