cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Post Prodigy
Post Prodigy

Patch Error with Collection

I have initialized my collection and set some data types in the initialization.    I can patch to the collection successfully, but when I try to patch the collection to the SharePoint list I am getting a strange error.   Per the documentation you can patch a collection item to Blank() as shown below.

 

Initial CollectInitial Collect

 

 

See Images below.  #1 patch to collection, #2 Collection & #3 Patch to SharePoint list error.

 

Patch CollectionPatch Collection

 

 

CollectionCollection

 

 

ErrorsErrors

 

I don't understand why it's seeing Effort and Week ending as a table and am not sure how to correct this.

 

@mdevaney 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Post Prodigy
Post Prodigy

Re: Patch Error with Collection

I figured it out.

 

I had tried this before but was getting errors here as well.  It's working now.

 

I should have referenced it as colEffort[@effort] and colEffort[@WeekEnding]

 

 

 

 

View solution in original post

4 REPLIES 4
Highlighted
Frequent Visitor

Re: Patch Error with Collection

Hi @JR-BejeweledOne ,

Would something like the below work?
ForAll(colEffort, Patch(DataSource,Defaults(DataSource),{Effort:ThisRecord.Effort}))

Highlighted
Post Prodigy
Post Prodigy

Re: Patch Error with Collection

I don't know.   I would like to understand why it's seeing it as a table.  It isn't a table and shouldn't be seen that way.   Data types are defined in collections all the time.

 

Example is the ShowSave: true.   This identifies this as a true/false and it's not seen as a table, although I am not patching it as blank() in the next step.  

 

If you look at the documentation for Blank, the example shows setting a text value to Blank().    So that shouldn't be the issue.

 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-isblank-isempty

Highlighted
Frequent Visitor

Re: Patch Error with Collection

In your patch you reference colEffort.Effort, as colEffort is a collection it will be seen as a table, where as you should be accessing a record. For example if you did something like First(colEffort).Effort I guess it would accept it.

Highlighted
Post Prodigy
Post Prodigy

Re: Patch Error with Collection

I figured it out.

 

I had tried this before but was getting errors here as well.  It's working now.

 

I should have referenced it as colEffort[@effort] and colEffort[@WeekEnding]

 

 

 

 

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,645)