cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Scott_P
Level 8

Patch no longer working

I have a patch on a gallery that was working until the most recent update (Seems to have been updated today to 3.18122.23)

The patch is on a gallery (Gallery4) subtitle onselect, and it patches the data from Gallery4_1 that the user has input.

 

 

ForAll(  AddColumns(Gallery4_1.AllItems, "temporaryID", id),  UpdateIf(Answers, id = temporaryID, {Answer: If(Radio60_1.Selected.Value = "Yes", 1, Radio60_1.Selected.Value = "No", 0, Radio60_1.Selected.Value = "N/A",2, Blank()), Evidence: EvidenceBox.Text, DidWell: If(Checkbox4.Value = true, 1,0)}))

 

I have added a column (temporaryID) to provide disambiguation (cannot seem to be able to use the disambiguation operator with Gallery.AllItems).

 

Any help is appreciated.  I cannot publish any updates until I find a workaround for this.

1 ACCEPTED SOLUTION

Accepted Solutions
Scott_P
Level 8

Re: Patch no longer working

My primary concern is that they have improved the speed of the gallery, so I don't think it it has time to patch the collection before it changes screen. I tested this theory by having the patch on start of a timer triggered by the first gallery and then change the options on the second gallery when the timer ends - turns out that it patches fine doing this. I set the timer duration to 1 so that it's the lowest amount of time possible. I set the options by declaring the options as a variable (set on visible to set it the first time and then the change is triggered at the end of the timer).

 

On visible

This makes the first in my table the default selection and sets the second gallery's options from what is selected in the first gallery (SectionVar) 

UpdateContext({DefaultSel: Gallery12.Selected}); UpdateContext({DefaultSel:{}}); UpdateContext({DefaultSel: First(Set(SectionVar, Filter(Answers, SectionName = Gallery12.Selected.Result)) first gallery; UpdateContext({timer: true}) 

button on first gallery;

UpdateContext({timer: true})

- On timer start 

ForAll( AddColumns(Gallery4_1.AllItems, "temporaryID", id), UpdateIf(Answers, id = temporaryID, {Answer: If(Radio60_1.Selected.Value = "Yes", 1, Radio60_1.Selected.Value = "No", 0, Radio60_1.Selected.Value = "N/A",2, Blank()), Evidence: EvidenceBox.Text, DidWell: If(Checkbox4.Value = true, 1,0)})) 

On timer end; 

UpdateContext({timer:false}); Set(SectionVar, Filter(Answers, SectionName = Gallery12.Selected.Result)) 

 

I hope this helps

2 REPLIES 2
James_Hellfeier
Level: Powered On

Re: Patch no longer working

I have also been struggling with Patch() this morning. I opened an app that was working before the last update and all of a sudden;

Patch( [dbo].[] ) : Patch works perfectly

Patch( Collection ) : Patches blank values (even if the field has no update being pushed through the Patch.)

 

Reloading the Collection from the [dbo] seems to refresh all of the records to their true values, however, the local Collection is butchered every time I update a record.

 

Scott_P
Level 8

Re: Patch no longer working

My primary concern is that they have improved the speed of the gallery, so I don't think it it has time to patch the collection before it changes screen. I tested this theory by having the patch on start of a timer triggered by the first gallery and then change the options on the second gallery when the timer ends - turns out that it patches fine doing this. I set the timer duration to 1 so that it's the lowest amount of time possible. I set the options by declaring the options as a variable (set on visible to set it the first time and then the change is triggered at the end of the timer).

 

On visible

This makes the first in my table the default selection and sets the second gallery's options from what is selected in the first gallery (SectionVar) 

UpdateContext({DefaultSel: Gallery12.Selected}); UpdateContext({DefaultSel:{}}); UpdateContext({DefaultSel: First(Set(SectionVar, Filter(Answers, SectionName = Gallery12.Selected.Result)) first gallery; UpdateContext({timer: true}) 

button on first gallery;

UpdateContext({timer: true})

- On timer start 

ForAll( AddColumns(Gallery4_1.AllItems, "temporaryID", id), UpdateIf(Answers, id = temporaryID, {Answer: If(Radio60_1.Selected.Value = "Yes", 1, Radio60_1.Selected.Value = "No", 0, Radio60_1.Selected.Value = "N/A",2, Blank()), Evidence: EvidenceBox.Text, DidWell: If(Checkbox4.Value = true, 1,0)})) 

On timer end; 

UpdateContext({timer:false}); Set(SectionVar, Filter(Answers, SectionName = Gallery12.Selected.Result)) 

 

I hope this helps

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Top Community Contributors for September  2019

Top Community Contributors for September 2019 🎉🎉

Let's thank our top community contributors

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

Top Kudoed Authors
Users Online
Currently online: 245 members 5,482 guests
Please welcome our newest community members: