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)
  • Ram Prakash Duraisamy Profile Picture
    5,593 Super User 2025 Season 2 on at
    Hi,
     
    Below link help you to understand more about this Power Apps Performance Optimization Guidelines - Matthew Devaney
     
    I can give some simple examples:
     
    1. Collect() -- You can use this as a Local Collection, can be reusable multiple times
    2. Patch () -- It will Create/update records in Dataverse and we can have Error Handling / Get the record ids etc.
     
    Please mark as answer if my suggestion helps.
    Subscribe here for More Useful videos : https://www.youtube.com/@rampprakash3991
  • Verified answer
    WarrenBelz Profile Picture
    153,040 Most Valuable Professional on at
    Patch is always the best option - Collect is designed to store "local" data in collections. As you have noted, it has no error handling, no specific control over fields and does not return the record sent, Although it technically works in some circumstances (sending bulk table data), there is really no good reason to use it for any data source writing.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   
     
     
     
     

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