cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Max1
Advocate IV
Advocate IV

Server Response ETAG mismatch (Conflicts exist with changes on the server, please reload)

Hello,

 

I have read some of the other posts on this where patch functions are interfereing with submit functions. However, I am only using a patch function when this error occurs, and I'm wondering if I'm using it incorrectly, perhaps you can help! My app logs what jobs operators are doing.

 

I have a form which I use submit form to create a record in sharepoint (to start the job). At the same time I patch some info to a separate data source (this seems to work fine) using the following function:

 

SubmitForm(Form_job_running);
Refresh('Production Database');
Patch('Production Database', First(Filter('Production Database',ID=Value(DataCard_jobID.Text))),
	{
        status: "Running",
        Job_Start: Now()
	}
     );
UpdateContext({JobRunning:true});
Patch('Production Data Times',
	     {
             Job_MO: label_jobmo.Text,
	         Start: Now(),
             Job_ID: DataCard_jobID.Text,
             job_pause_count: DataCardValue5_1.Text,
             Operator: dropdown_user.Selected.Value
	     }
     )

Then when I want to pause the job I get the error (sometimes) using the following:

 

Patch('Production Data Times', First(Filter('Production Data Times',Job_ID=DataCard_jobID.Text, job_pause_count=DataCardValue5_1.Text,End=Blank())),
	{End: Now(),
    Operator: dropdown_user.Selected.Value
	}
);

Patch('Production Database',First(Filter('Production Database',ID=Value(DataCard_jobID.Text))),
    {
        Description: DataCardValue22.Text,
        Job_MO: label_jobmo.Text,
        customer_part_num: label_custpartnum.Text,
        Job_Type: Label_job_type_1.Text,
        Booth_number: label_boothnumber_1.Selected.Value,
        Cycles_Number: Value(DataCard_cycles_number.Text),
        parts: Value(DataCardValue1_1.Text),
        operators_total: Value(Dropdown1_1.Selected.Value),
        status: "Paused",
        overtime_hours: Value(DataCardValue9_1.Text),
        reworked_parts: Value(DataCardValue14_1.Text),
        Lab_Qualification_Number: DataCardValue15_2.Text,
        cycletime_secs: Value(TextInput_cyclesecs_1.Text),
        cycletime_mins: Value(TextInput_cyclemins_1.Text),
        guntime_endhours: Value(TextInput_endgunhours_2.Text),
        guntime_endmins: Value(TextInput_endgunmins_2.Text),
        guntime_starthours: Value(TextInput_startgunhours.Text),
        guntime_startmins: Value(TextInput_startgunmins.Text),
        engineering_comments_checkbox: slider_engineering_comments.Value,
        engineering_feedback: DataCardValue13_1.Text,
        launchpad_checkbox: slider_launchpad_comments.Value,
        job_pause_count: DataCardValue5_1 +1
    }
    );

Please can you tell me if there's a better way to do this and how to avoid the error I'm getting? Should I be using the update function?

 

Thank you 🙂

 

 

5 REPLIES 5
Anonymous
Not applicable

Hi @Max1,


Can you provide more detail on how you "pause the job?" Is this a separate button? If so, adding a Refresh before the Patches as so should do the trick:

 

Refresh('Production Data Times');
Patch('Production Data Times', First(Filter('Production Data Times',Job_ID=DataCard_jobID.Text, job_pause_count=DataCardValue5_1.Text,End=Blank())),
{End: Now(),
Operator: dropdown_user.Selected.Value
}
);

Refresh('Production Database');
Patch('Production Database',First(Filter('Production Database',ID=Value(DataCard_jobID.Text))),
{
Description: DataCardValue22.Text,
Job_MO: label_jobmo.Text,
customer_part_num: label_custpartnum.Text,
Job_Type: Label_job_type_1.Text,
Booth_number: label_boothnumber_1.Selected.Value,
Cycles_Number: Value(DataCard_cycles_number.Text),
parts: Value(DataCardValue1_1.Text),
operators_total: Value(Dropdown1_1.Selected.Value),
status: "Paused",
overtime_hours: Value(DataCardValue9_1.Text),
reworked_parts: Value(DataCardValue14_1.Text),
Lab_Qualification_Number: DataCardValue15_2.Text,
cycletime_secs: Value(TextInput_cyclesecs_1.Text),
cycletime_mins: Value(TextInput_cyclemins_1.Text),
guntime_endhours: Value(TextInput_endgunhours_2.Text),
guntime_endmins: Value(TextInput_endgunmins_2.Text),
guntime_starthours: Value(TextInput_startgunhours.Text),
guntime_startmins: Value(TextInput_startgunmins.Text),
engineering_comments_checkbox: slider_engineering_comments.Value,
engineering_feedback: DataCardValue13_1.Text,
launchpad_checkbox: slider_launchpad_comments.Value,
job_pause_count: DataCardValue5_1 +1
}
);

 

Hello,

 

Thank you very much for your response. I will try that.

 

Yes the pause button is separate. Please can you comment on whether the patch command is the bes for this scenario? I've read in other posts (such as https://powerusers.microsoft.com/t5/General-Discussion/Server-Response-ETAG-mismatch-Conflicts-exist... that using updateif might be better?)

 

Thanks for your help 🙂

Hello,

 

Unfortunately adding the refresh before the patch didn't work. However I've since tried changing the item property of the form. Instead of being LastSubmit, I've writted a context variable duing the SubmitForm function and use this with a filter to find the correct item. So far it seems to be working but this was an intermittent problem before so I will reserve judgement until its been tested for a few days.

 

Thanks again!

 

Max

Anonymous
Not applicable

Hi @Max1, did that solve your problem?

 

I am facing the same issue. Patching a record immediately after submit using lastsubmit.

@Max1 

@Anonymous 

Hi guys,

 

I have almost the same problem.

Even if you patch an item twice it gives the same error. but it you patch an item then patch another one, afterward there is no error for patching the first one.

I tried to refresh the database but didn't worked.

Any comment?

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,490)