cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tomgardzinski
Helper IV
Helper IV

ETAG erros, and more ETAG errors while Patching

Hello,

I am wondering if there is any help out there for ETAG errors while Patching.

I have a screen with a form that asks 10 questions. The user can save each question as they go a long. 

SaveButton1 and SAveButton 2 (and so forth) have their OnSelects with a Patch. I've tried many different things with Patch including using LookUp, and also First(Filter... Here is the code I am currently using or have recently tried:

1. Patch(IPAC_AuditList, GalleryAuditList.Selected, AuditForm.Updates)

2. Patch(IPAC_AuditList, GalleryAuditList.Selected, {'Q1.2Results': DDQ1_2DataCardValue.Selected, 'Q1.2NCIssue': 'Q1-2NCIssueDataCardValue'.Text, 'Q1.2AuditorNotes': 'Q1.2AuditorNotesDataCardValue'.Text})

 

I've also tried using Refresh before the Patch coding.

 

Can anyone help me with this issue? I am on the cusp of getting some institutional buy in with Power Apps, but getting these errors for what seems like a simple save and update to a datasource seriously ruins any appetite with Power Apps and other MS automation tools.

Please help @v-siky-msft @Pstork1 @mdevaney @yashag2255 @RezaDorrani 

1 ACCEPTED SOLUTION

Accepted Solutions

To anyone interested I fixed this issue on my own. Instead of having separate buttons with OnSelect Patching the records to the main data source, I first collected each response to each question in a separate Collection (table). Then when the user has all questions complete, or is ready to "Save" I then run Patch on the OnSelect of a "Save" Button. My only issue now is that I have approximately 50 questions, which means 50 Collections, and then trying to Patch 50 collections to the datasource seems to be not working as the app is getting quite clunky and performance is an issue.

View solution in original post

5 REPLIES 5
Pstork1
Dual Super User III
Dual Super User III

If I am following you then you are doing multiple patches against the same record without doing a refresh between patches.  Is that correct?  If it is then I suspect your issue is that when you do your second patch against the record its trying to patch the original cached record, but you've already changed it so it throws an error.  You really shouldn't try to patch the same record over and over again without refreshing the data source.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

I should have include the entire code, and not just the Patch code.

 

In fact I am using a Refresh before the Patch coding.

 

1. Refresh(IPAC_AuditList);
Patch(IPAC_AuditList, GalleryAuditList.Selected, AuditForm.Updates)

2. Refresh(IPAC_AuditList);

Patch(IPAC_AuditList, GalleryAuditList.Selected, {'Q1.2Results': DDQ1_2DataCardValue.Selected, 'Q1.2NCIssue': 'Q1-2NCIssueDataCardValue'.Text, 'Q1.2AuditorNotes': 'Q1.2AuditorNotesDataCardValue'.Text})

v-xida-msft
Community Support
Community Support

Hi @tomgardzinski ,

Based on the ETAG error that you mentioned, I think this error would occur when multiple users edit your same data source (SP List) records at the same time.

 

Have you taken a try to update records within your data source uing UpdateIf function? Please consider modify your data source records using UpdateIf function instead of Patch function, then check if the issue is solved.

 

On your side, please consider modify your formula as below:

Refresh(IPAC_AuditList);
UpdateIf(
         IPAC_AuditList,
         ID = GalleryAuditList.Selected.ID, // or type PrimaryColumn  = GalleryAuditList.Selected.PrimaryColumn
         {
            'Q1.2Results': DDQ1_2DataCardValue.Selected, 
            'Q1.2NCIssue': 'Q1-2NCIssueDataCardValue'.Text, 
            'Q1.2AuditorNotes': 'Q1.2AuditorNotesDataCardValue'.Text
         }
);
Refresh(IPAC_AuditList)

 

Please 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.

Hello @v-xida-msft ,

Here is the update I made to my OnSelect for my save button:

Refresh(IPAC_AuditList);
UpdateIf(IPAC_AuditList, Audit_ID = GalleryAuditList.Selected.Audit_ID, {'Q1.1Result': DDQ1_1DataCardValue.Selected, Q1_x002e_1NCIssue: 'Q1.1NCIssueDataCardValue'.Text, Q1_x002e_1AuditorNotes:'Q1.1AuditorNotesDataCardValue'.Text});
Refresh(IPAC_AuditList)

Where Audit_ID is my ID column. Here is the corresponding error I received:

UpdateIf error.PNG

 

I have only been running this app and testing in browser mode so far. I have tried playing it from the web link and I still get the same error. Could this be a sharepoint issue? Rather than a power apps issue?

Looking at the history of issues in the community forum, there seems to be a lot that concern Submit, LastSubmit, UpdateIf, and Patch. It appears that PowerApps and Sharepoint only like one submission per a session. Two or more and there are failures.

Can this be escalated?

To anyone interested I fixed this issue on my own. Instead of having separate buttons with OnSelect Patching the records to the main data source, I first collected each response to each question in a separate Collection (table). Then when the user has all questions complete, or is ready to "Save" I then run Patch on the OnSelect of a "Save" Button. My only issue now is that I have approximately 50 questions, which means 50 Collections, and then trying to Patch 50 collections to the datasource seems to be not working as the app is getting quite clunky and performance is an issue.

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,982)