I have an app that has been working beautifully and just began throwing an error when I am attempting to patch form updates. I cannot think of anything that has changed: the data source is the same, the formulas are the same, the form inputs are the same. A patch I have set up in another part of the app is able to patch to the same data source, so I don't believe it has to do with the SharePoint list to which it's referencing. Below are the other things I have tried so far to figure out what's going on:
1. I ran Monitor but it did not provide any more detail to the error than the error message.
2. I refreshed the data sources.
3. I signed out of the account and signed back in.
4. I researched solutions online.
Some details about the app:
- A global variable, VarNew, is set to true when the user selects to complete a new form. Otherwise, if the user is completing a draft that was saved previously, the variable is set to false.
- A global variable varFormData is set when either the user selects to complete a new form, or when the user selects to complete a draft previously saved. When the user selects to complete a new form, the variable is set as follows, in order to create a new item in SharePoint.
- Set(varFormData, Defaults(Proposals)) && Set(varNew, true)
- There are four screens with four forms, all of them with varFormData as the items property, and then there is a review form at the end.
- When the user gets to the end they can select to Send the request or to Save as draft. The formulas for each are below.
- Send request:
If(varNew = true,
SubmitForm(ReviewForm),
Patch(Proposals,
LookUp(Proposals, ID = varFormData.ID), BasicInfoForm.Updates, SolicitationForm.Updates, StrategyForm.Updates, BudgetForm.Updates, {Status: "Request in review"}));
EmailNotificationProposalRequest.Run(varFormData.ID);
If(IsEmpty(Errors(Proposals)), Notify("Success", NotificationType.Success));
ResetForm(BasicInfoForm); ResetForm(SolicitationForm); ResetForm(StrategyForm); ResetForm(BudgetForm); ResetForm(ReviewForm); Set(varNew, false);
Navigate(LoginScreen) && Notify(First(Errors(Proposals)).Message, NotificationType.Error)
- Save as draft
If(varNew = true,
Patch(Proposals, varFormData, BasicInfoForm.Updates, SolicitationForm.Updates, StrategyForm.Updates, BudgetForm.Updates, {Status: "Draft"}),
Patch(Proposals, LookUp(Proposals, ID=varFormData.ID), BasicInfoForm.Updates, SolicitationForm.Updates, StrategyForm.Updates, BudgetForm.Updates, {Status: "Draft"}, {RequestType: "Proposal request"}));
If(IsEmpty(Errors(Proposals)), Notify("Success", NotificationType.Success);
Navigate(LoginScreen), Notify(First(Errors(Proposals)).Message, NotificationType.Error));
ResetForm(BasicInfoForm); ResetForm(SolicitationForm); ResetForm(StrategyForm); ResetForm(BudgetForm)
I am probably missing some needed detail, so just ask. Again, it has worked seamlessly for weeks.