I have 'EditForm1'.
I have two buttons - 'Save Draft' and 'Submit'. In each button is the variable varPressed.
- Save Draft button: UpdateContext({varPressed: "In Draft"});
- Submit button: UpdateContext({varPressed: "Submit Update"});
There are several fields and controls I want evaluated for 'Save Draft' or 'Submit'
When I access an existing item and make a change, but don't complete the form, and use the 'Save Draft' button Power Apps creates another version of the item rather than overwriting the changes. I believe I need to add an 'If' that compares the List 'ItemID' to the 'ID' in EditForm1, but I am not sure where or how.
In the 'OnSuccess' of EditForm1 I have the following 'Switch' command.
Switch(
varPressed,
"In Draft",
Patch(
'TrackerList',
{Status: {Value: "In Draft"}},
"Submit Update",
If(
CombBox1.Seleted.Value = "In Draft" && Label6_3.Text = "Yes" && DataCardValue7_9.Selected.Value = "Other",
Patch(
'TrackerList',
{Status: {Value: "Pending Approval"}})