cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kudo Kingpin
Kudo Kingpin

Problem with Patch and Collect, code that was working perfectly fine earlier

I’ve been building an App now for two months, and am close to finishing it, but this morning the behaviour is really strange and this is without me touching the affected areas. They were working perfectly as of yesterday morning, but this morning there is some really bizarre behaviour.

 

  1. I have a Collection connected to a Gallery, in the Gallery I have multiple Textboxes, DropDowns etc. and the Gallery is used for editing the collection. As of this morning, when I patch a blank row into the collection, all existing Rows in the Gallery are reset to blank.
  2. Typically after editing items in the above Gallery, I “Collect” them to a new Collection, which I then use to pass on a JSON to Flow / SQL Procedures to update tables in SQL DB.

So in essence patch and Collect were working perfectly fine yesterday, but as of this morning I'm having problems. If someone from the PowerApps can reach out to me, i'd be happy to share the session details.

1 REPLY 1
Community Support
Community Support

Hi @UB400 ,

Do you mean that

1)you patch a blank row into the collection,then all existing Rows in the Gallery are reset to blank?

2)this app used to word good, while hasn't worked till this morning?

Could you show me the formulas about the collection, especially the patch part?

Please check whether you use Collect, ClearCollect or Patch function to update the collection.

Each of them is different.

Using collection function could only create new records in the collection.

Using ClearCollect function will clear the original collection and replace with new data.

Using Patch function could create new records and update existing recprds.

Here are docs about these functions, please pay attention to distinguishing them:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-clear-collect-clearc...

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

 

 

Best regards,

 

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (7,846)