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

Power apps Patching to a SharePoint list is overriding other records.

Hello,  we have been using this app for about a year now and just after Christmas started seeing a bug in the App. 

 

The user will go in and see a gallery with their teams records in the user will go into each record and update info and save this info using Patch to a share Point list record. 

 

for some users when they have saved their record and then moved into another record from the gallery the power apps is saving the original record but then also saving over the new record that they have clicked into. 

 

i have added some features into the app so that they can't navigate away from a page whilst saving but this hasn't solved the issue can anyone please help? 

 

here is my save code

 

Patch(PDP1,{ID:PDPID},{MidYr_x0020_Ambition:'MyAmbition'.SelectedText,EndYr:MYA.SelectedText,MidYr_x0020_NextRole:NxtRole.Text});Refresh(PDP1); Refresh('PDP1 Objectives')

4 REPLIES 4
Highlighted
Power Participant
Power Participant

Re: Power apps Patching to a SharePoint list is overriding other records.

@Helen_BB 

 

To help with this issue of things saving over other things intermittently, try having the Patch reference the selected Gallery item directly instead of using bridge variables or bridge collections if possible.

 

When using those bridge approach it can introduce unpredictability and cause this kind of issue.

Highlighted
Helper III
Helper III

Re: Power apps Patching to a SharePoint list is overriding other records.

Hi Thank you for this suggestion, previously my code was ..

 

Patch(PDP,{ID:Gallery1.Selected.ID},{MidYr_x0020_Ambition:'My Ambition'.SelectedText,EndYr:MYA.SelectedText,MidYr_x0020_NextRole:NxtRole.Text});Refresh(PDP); Refresh('PDP Objectives')

 

and this is when my issue started happening so i swapped over to using a variable yesterday to see if this helped my issue but the problem is occurring in both scenarios.

 

Do you have any other suggestions? 

Highlighted
Power Participant
Power Participant

Re: Power apps Patching to a SharePoint list is overriding other records.

@Helen_BB 

 

If instead of single button, you instead put the button on each Gallery item and in Patch statement make sure to always reference the fields from inside the Gallery (they would always have the same control name of course) and also make sure to reference ThisItem instead of Gallery.Selected, does the issue still happen?

 

You can then try moving it outside the Gallery after that but if you put the button inside the gallery (so there would be one button per record instead of just one button) and rewrite the patch to use ThisItem an make sure it uses the controls in the Gallery, does the issue still occur even so?

 

 

Highlighted
Helper III
Helper III

Re: Power apps Patching to a SharePoint list is overriding other records.

Thanks for this 🙂

 

its a bit tricky as there are multiple pages once you click into an item from the Gallery but i can do some testing and see what happens. 

 

thank you 🙂

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response 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 (3,912)