cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JMMurphy
Level: Powered On

error message on toggle box patch to choice field in sharepoint

Hi

 

I have a toggle control which patches back to a choice field in SharePoint.    I have adjusted the expression with an odata wrapper which removed the error message in the powerapps editor, but I'm still getting the error below when the app runs.  The code appears to work, but it isn't a great user experience.

 

×
The requested operation is invalid. Server Response: Save Conflict Your changes conflict with those made concurrently by another user. If you want your changes to be applied, click Back in your Web browser, refresh the page, and resubmit your changes. clientRequestId: 5027e0ba-025c-4502-b897-e4042a252fa5 serviceRequestId: 5027e0ba-025c-4502-b897-e4042a252fa5
 
and
 
Conflicts exist with changes on the server, please reload. Server Response: ETAG mismatch. clientRequestId: 470b260c-2e2f-4b05-b751-fdaa8cab38df serviceRequestId: 470b260c-2e2f-4b05-b751-fdaa8cab38df
 
 
The code is in the OnChange property of the toggle control(I added the refresh statements to get rid of the errors on the formula as advised by some of the posts on this forum).
 
Refresh('Exec Update_3');If(tog_OpenClosed.Value=true,
Refresh('Exec Update_3');Patch('Exec Update_3',First( Filter( 'Exec Update_3', ID = gal_ExecUpdate.Selected.ID )),{EU_Status:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",ID:gal_ExecUpdate.Selected.ID,Value:"Open"}}),
Refresh('Exec Update_3');Patch('Exec Update_3',First( Filter( 'Exec Update_3', ID = gal_ExecUpdate.Selected.ID )),{EU_Status:{'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",ID:gal_ExecUpdate.Selected.ID,Value:"Closed"}})
)
3 REPLIES 3
Community Support Team
Community Support Team

Re: error message on toggle box patch to choice field in sharepoint

Hi @JMMurphy ,

Based on the error message that you mentioned, it seems to tell that you have faced a Conflict error within PowerApps. The Conflict error occurs when multiple users are editing same record within a data source.

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. Please consider modify your formula as below:

 

Refresh('Exec Update_3');
If(
tog_OpenClosed.Value=true, Patch(
'Exec Update_3',
LookUp('Exec Update_3', ID = gal_ExecUpdate.Selected.ID),
{
EU_Status: {
ID: gal_ExecUpdate.Selected.ID,
Value: "Open"
}
}
), Patch(
'Exec Update_3',
LookUp('Exec Update_3', ID = gal_ExecUpdate.Selected.ID),
{
EU_Status:{
ID: gal_ExecUpdate.Selected.ID,
Value: "Closed"
}
}
)
)

 

In addition, you could also consider use UpdateIf function to update your Choice field instead of Patch function, please modify above formula as below:

Refresh('Exec Update_3');
If(
   tog_OpenClosed.Value = true,
   UpdateIf(
          'Exec Update_3',
           ID = gal_ExecUpdate.Selected.ID,
           {
              EU_Status: {
                             ID: gal_ExecUpdate.Selected.ID,
                             Value: "Open"
                        }
           }
    ),
    UpdateIf(
           'Exec Update_3',
            ID = gal_ExecUpdate.Selected.ID,
            {
              EU_Status:{
                          ID: gal_ExecUpdate.Selected.ID,
                          Value: "Closed"
                        }
            }
     )
)

If the issue still exists, please consider turn off the "Improved app rendering (final validation)" option and turn on the "Formula-level error management" option within Advanced settings of App settings of your app, then re-publish your app and try above formula again, check if the issue is fixed.

 

Best regards,

 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
JMMurphy
Level: Powered On

Re: error message on toggle box patch to choice field in sharepoint

Thansk @v-xida-msft I've followed your suggestions but I'm afraid I am still getting the error messages.

Community Support Team
Community Support Team

Re: error message on toggle box patch to choice field in sharepoint

Hi @JMMurphy ,

Have you taken a try to re-create a new app based on your data source, or re-create a new connection to your data source within your app?

 

Currently, I could not reproduce your issue on my side. The user @AJ13 has faced similar issue with you, please check my response within the following thread:

https://powerusers.microsoft.com/t5/General-Discussion/ETAG-mismatch/m-p/237814

 

https://powerusers.microsoft.com/t5/General-Discussion/PowerApps-form-resetting-fields-on-Save/m-p/2...

 

Please also consider take a try with above solution, check if the issue is solved.

 

Best regards,

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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,568)