I have an edit form with a "submit" button that has the following instructions:
If(
Or(
And(Metrics_Gallery.Selected.'Goal type'="Less than", Value(MetricResult.Text)<=Value(Metrics_Gallery.Selected.Threshold)),
And(Metrics_Gallery.Selected.'Goal type'="More than", Value(MetricResult.Text)>=Value(Metrics_Gallery.Selected.Threshold)),
And(Metrics_Gallery.Selected.'Goal type'="Equal to", Value(MetricResult.Text)=Value(Metrics_Gallery.Selected.Threshold))),
Patch(SMCR,Metrics_Gallery.Selected,{Fail:"Pass"}),
Patch(SMCR,Metrics_Gallery.Selected,{Fail:"Fail"}))
;
SubmitForm(Form1)
And the the OnSuccess property of the editform:
Patch(SMCR,Metrics_Gallery.Selected,{Status:"Updated"})
;
Navigate('Home page V2')
Basically I'm asking it to evaluate if a metric "passes" o "fails" a certain criteria, and then I assign an status to that metric and submit the form, while assigning a "updated" status to it if the form is successful.
I though these were pretty straighforward instructions, but for some reason everytime that I try to submit the form powerapps takes almost 30 seconds loading and submitting the form. Is there any way in which I can fix this?