I have a SharePoint list that is used to collect support requests. I have created a custom PowerApps form and am trying to add a custom dialog that pops up when the "Submission Status" selected value is "Draft". The pop-up opens and informs the user that their request is still in Draft status and asks if they want to Submit it now or save it as a draft. I added two buttons, one for Submit and one for Save as Draft. When they click "Submit", I need the Submission Status value to change to "Submitted". The only two options are "Draft" and "Submitted". If they click "Save as Draft" it just saves the form and closes. The "Save as Draft" is no problem. I can't get the "Submit" button to set the "Submission Status" value to "Submitted".
Here are the formulas I have used so far:
Custom Save button OnSelect on main form
If(
SubmissionStatusValue.Selected.Value = "Draft",
UpdateContext({showDialog:true}),
SubmitForm(SharePointForm1))
If the selected submission status is "Draft", set the variable showDialog to True, otherwise submit the form.
Submit button OnSelect in dialog group
UpdateContext({varSubmissionStatus: "Submitted"});
UpdateContext({showDialog: false});
SubmitForm(SharePointForm1);
Set the variable varSubmissionStatus to "Submitted", set the variable showDialog to false and submit the form.
grpShowDialog (consists of all elements in the pop-up dialog) Visible parameter
showDialog
SubmissionStatusValue ComboBox DefaultSelectedItems parameter
If(
SharePointForm1.Mode = FormMode.New,
LookUp(Choices('M&D SharePoint Support Requests'.'Submission Status'), Value = "Draft"), If(
showDialog,
LookUp(Choices('M&D SharePoint Support Requests'.'Submission Status'), Value = varSubmissionStatus),
Parent.Default))
If form mode is new, set the default Submission Status value to Draft. Otherwise, if the showDialog variable is true, set the default Submissions Status value to the value of varSubmissionStatus which should have been set to "Submitted" if the Submit dialog button was clicked. Otherwise, set the default to the parent default.
This does not work. The Submission Status remains "Draft".
Any ideas what I'm doing wrong?