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 / Patching a collection ...
Power Apps
Answered

Patching a collection to a Dataverse table

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

App creates a collection by filtering a Dataverse table:

 

ClearCollect(ExampleCollection,Filter(ExampleDataverseTable,ExampleCoumnValue=ExampleValue))

 

The app both updates existing rows and adds new rows to the collection. The Collection is then patched back to the Dataverse table.

 

Patch(ExampleDataverseTable,ExampleCollection)

 

For adding new rows this seems to work fine. However, as soon as I edit an existing row the patch action generates a Network error.

 

NaivePowerApper_0-1685636898742.png

 

Is there a straightforward way to resolve this issue? 

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @NaivePowerApper ,

     

    Because the collection contains some read-only fields in ExampleDataverseTable, when you use it to update the data source, PowerApps thinks that you also need to modify these read-only fields. The solution is to cull these read-only fields.

     

    ForAll(
     ExampleCollection,
     If(
     IsBlank(
    	 LookUp(ExampleDataverseTable,Name=ExampleCollection[@Name])
    		),
    	 Patch(
    	 ExampleDataverseTable,
    	 Defaults(ExampleDataverseTable),
    	 ThisRecord
    		),
    	 Patch(
    	 ExampleDataverseTable,
    		LookUp(ExampleDataverseTable,Name=ExampleCollection[@Name]),
    		{
    		Column1:ThisRecord.Column1,
    		Column2:ThisRecord.Column2	
    		}
    	 )
    	)
    )

     

    Best Regards,

    Bof

  • NaivePowerApper Profile Picture
    Microsoft Employee on at

    Thanks, this was super helpful.

     

    I messed around with it a little more. It appears that it's possible to achieve the same thing without the ForAll loop by using ShowColumns.

     

    Patch(ExampleDataverseTable,ExampleCollection,ShowColumns(ExampleCollection,"ExampleCollumn1","ExampleCollumn2"))

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!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 545 Most Valuable Professional

#2
Haque Profile Picture

Haque 314

#3
Kalathiya Profile Picture

Kalathiya 234 Super User 2026 Season 1

Last 30 days Overall leaderboard