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 / Modify several records...
Power Apps
Unanswered

Modify several records in a datasource

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello 🙂

 

I have a collection that contains two colums: "RecordID", "Quantity". It contains several records.

 

I need to update only the "Quantity" field in my Datasource for each apropriate RecordID.

 

I can do it one at a time. But how to update them alle at once?

 

Thanks in advance 🙂

Categories:
I have the same question (0)
  • SmartMeter Profile Picture
    248 on at

    Hi Jesper, 

    To do this, you will need to use a patch command. You can find the basic syntax here: 

    https://powerapps.microsoft.com/en-us/tutorials/function-patch/

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thanks SmartMeter,

     

    The Patch is working fine. The challenge is getting alle the records in my collection to modfy fields in different records in the datasource. I am trying something like this:

     

     Collect(xUpdateChanges,UpdateChanges);
     ForAll(UpdateChanges,
     Patch(Vareliste,First(xUpdateChanges).RecordId),{Sorter: Value(First(xUpdateChanges).Sorter)};
     Remove(xUpdateChanges,First(xUpdateChanges))
     )

     

    Was also looking at this:

     

    UpdateIf(Vareliste,UpdateChanges.RecordId exactin Vareliste.RecordId,{Sorter: UpdateChanges.Sorter})

    I much prefered the second option, But cant get any of them to work.

     

    Or is there some entirely different way of doing it?

     

    Thanks in advance.

     

     

  • SmartMeter Profile Picture
    248 on at

    Hi again Jesper,

    I believe this thread might help you do what you want to do. From what I can see, you are explicitly referencing the id of the record you want updated, so your code will inherently only apply to one record. Check out the forall expression in this poster's question, it might be what you are looking for 😉

     

    https://powerusers.microsoft.com/t5/PowerApps-Forum/Hot-to-Patch-to-update-multiple-records/td-p/51714

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

#2
11manish Profile Picture

11manish 242

#3
Valantis Profile Picture

Valantis 198

Last 30 days Overall leaderboard