I have a form with 2 buttons, SUBMIT and SAVE. I want it to send email to a user based on the button that is used, so if they click the SUBMIT button an email would go out saying a New form was submitted. If they click the SAVE button, it would send an email saying the form was Updated. It's currently sending out 2 emails, I only want it to send one or the other.
On the SUBMIT button I have this for OnSelect property:
Set(varFormStatus,"Saved"); SubmitForm(EditForm); Notify("The form was saved successfully",NotificationType.Success,0)
On the SAVE button I have this for OnSelect property:
Set(varFormStatus,"Updated"); SubmitForm(EditForm); Notify("The form was saved successfully",NotificationType.Success,0)
On the EditForm I have this on the OnSuccess property:
If(varFormStatus, "Pending";Office365Outlook.SendEmailV2(
"myemail@EMAIL.com",
"New Reallocation Request",
"Hello " & User().FullName &
"<a href='https://apps.powerapps.com/play/e/default-3e1c8459-76b0-41e2-9384-08b8e6adadbc/a/ab1b-0fe6287f23ca?tenantId=3e1c86adadbc&hint=f70326e4-b7&sourcetime=2023-08-18%2014%3A31%3A04Z'> Form Link ,</a>"
));
If(varFormStatus, "Updated";Office365Outlook.SendEmailV2(
"myemail@EMAIL.com",
"Reallocation Request Updated",
"Hello " & User().FullName &
"<a href='https://apps.powerapps.com/play/e/default-3e1c8459-76b0-41e2-9384-08b8e6adadbc/a/ab1b-0fe6287f23ca?tenantId=3e1c86adadbc&hint=f70326e4-b7&sourcetime=2023-08-18%2014%3A31%3A04Z'> Form Link ,</a>"
));
It's sending out both emails 😞