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.
Solved! Go to Solution.
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
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.
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
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
206 | |
187 | |
82 | |
51 | |
37 |
User | Count |
---|---|
288 | |
244 | |
121 | |
76 | |
55 |