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 / Best practice - Collec...
Power Apps
Answered

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,753 Super User 2026 Season 1 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
    155,066 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 522

#2
WarrenBelz Profile Picture

WarrenBelz 437 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 405

Last 30 days Overall leaderboard