web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Best practice - Collec...
Power Apps
Unanswered

Best practice - Collect vs Patch in Dataverse

(0) ShareShare
ReportReport
Posted on by 143

Hi everyone, hope you're doing well 🙋.

 

I'm currently taking a non-official course on Power Apps and Dataverse, and I came across a question regarding best practices when inserting records into a Dataverse table.

In the course, they taught us to use the Collect() function to insert new records, and to use Patch() only for updating existing ones. However, I asked through another channel (ChatGPT), and was told that in real-world environments it's recommended to use Patch() for both inserting and updating. The reasoning was that Collect() doesn't handle errors, doesn't return the generated ID, and doesn't give as much control over the inserted record.

Could you please confirm if that's accurate? Is it considered a best practice to avoid Collect() when working with Dataverse?

I really appreciate any insights. And if any MVP or professional with experience in production scenarios could share their perspective, it would be incredibly helpful to have a solid reference.

Thanks in advance!

I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at
     
    Just to be clear, Collect does NOT add records to Dataverse, it adds data to a Collection, which you can in fact, if you want, wrap in Error handling.
     
    Patch is for actually "creating" new data in Dataverse, so they are not related, nor used for the same thing.
     
    Patch is for putting data into Dataverse. You could patch a collection too, but I no of no one who does that, to add to collections its Collect or ClearCollect, which you can in fact put error handling around, but still is different than Patch. People use patch on Collections to CHANGE data in the Collection.
     
    So the question is essentially a non-starter question, as it relates to Data creation versus data Collection.
     
    Hope that clarifies, and no idea where you read Collect puts data in Dataverse or which AI told you that, but fire them immediately. :)
     
     
  • WarrenBelz Profile Picture
    153,040 Most Valuable Professional on at
    This is identical to this thread of yours - please do not duplicate posts as it only adds workload to the already small number of responders assisting you.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard