cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Patch a Collection - Attachment Error

I am trying to Patch a Collection (which is based on a SharePoint List) using Form.Updates.  When I try to run the patch, I get the following error:updateerror4.pngThe Collection is created by doing a ClearCollect on the Datasource, which is a SharePoint LIst.  I have looked at the collection and confirmed that This column is not added by the ClearCollect (Seems to be the only column not added).  Thoughts?

 

 

 

 

 

 

6 REPLIES 6
Highlighted
Community Champion
Community Champion

Re: Patch a Collection - Attachment Error

Are you trying to patch a collection to a sharepoint list to create new items or to edit existing ones?

Highlighted
Helper I
Helper I

Re: Patch a Collection - Attachment Error

Right now I'm trying to just patch the collection stored inside PowerApps with Form.Updates.  I'll eventually Patch it back to SP.

 

So, I'm doing a ClearCollect on My SharePoint List, which get the SP List Schema, I also have a Form on my Page that uses the SP List as the Datasource.  I want to take the updates made in the Form and Patch it to a specfic record in my collection, but I get that attachment error, which I assume is related to the new Attachment functionality recently released. 

Highlighted
Microsoft
Microsoft

Re: Patch a Collection - Attachment Error

Hi

 

Can you provide more detail on the formula you're using to do the patch. If possible provide the key steps you're using that reproduce the issue.

 

Thanks

Garry Mc

Highlighted
Helper I
Helper I

Re: Patch a Collection - Attachment Error

Here's how you can reproduce it:

 

1).  Add a SharePoint Online list as a Datasource (Any will do)

2).  Create a new Blank App and connect to the Datasource

3).  Add 2 Forms on to the page, set thier Datasource to your SP List, set the mode of the Forms to New

4). Add 2 New Buttons on the Screen.  Call them CCButton and Patch Button

5). Set the OnSelect property of CCButton to:  ClearCollect(Coll1, Form1.Updates)

6). Set the OnSelect property of Patch Button to :  Patch(Coll1, First(Coll1), Form2.Updates)

Bonus

7). Instead of using Patch, watch it blow up the same way using UpdateIf:  Change Patch Button OnSelect to:  UpdateIf(Coll1, true, Form2.Updates)

 

With Patch, it actually shows the {Attachment} column is the problem, this error wasn;t available in UpdateIf, it was just more generic.

Highlighted
Microsoft
Microsoft

Re: Patch a Collection - Attachment Error

Thanks for the details - I'm able to reproduce your issue. I'll get back with the results of my investigation when I know more.

Microsoft
Microsoft

Re: Patch a Collection - Attachment Error

Hi

 

We've identified this as a bug and have created a bug to track this issue. In the meantime, if you specify each of the fields individually this should resolve your problem. We understand this is not ideal, but it should help you in the short term while we work on fixing the issue.

 

So replace:

Patch(Coll1, First(Coll1), Form2.Updates)

 

With:

Patch(Coll1, First(Coll1), {field1: Form2.Updates.field1, field2: Form2.Updates.field2, ... })

 

Let us know if this resolves your issue.

 

Thanks.

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (10,373)