Hi,
I need some help on the form validation and sending a notification email.
I have created a form using SharePoint list as a data source. There are few mandatory fields which want to validate on the submit button. Using the first part of the code, I am able to validate and submission happens only when all the required fields are filled. However, after adding logic for email notification, I get notification email though fields are blanks. How do I restrict my email notification on the submit button and make sure email is sent only when all the mandatory fields are filled? Quick response is appreciated.
If(
!Form1.Valid,
// Then
SubmitForm(Form1),
// Else
If(
IsEmpty(DataCardValue1),
// Then
Notify(
"Failed to submit, fill all required fields and try again.",
NotificationType.Error
),
// Else
ResetForm(Form1);
ResetForm(Form1);
Navigate('Thank you');
Notify(
"Submitted new record.",
NotificationType.Success
);
);
);
Office365.SendEmail(
"abc@xyz.com",
"EPO Intake Form - Submission Confirmation : " & DataCardValue1.Text & " Plot " & DataCardValue1.Text & " : " & User().FullName,
"Hi <b></b>" & Left(
User().FullName,
Find(
" ",
User().FullName
) - 1
) & "," & " <br><br>
Thank you for your submission." & "<br><br><b></b>" & "We will review and respond no later than two (2) business Days. <br><b> <b></b></b>" & " <br> Please feel free to reach out to abc@xyz.com if you have Any questions.<b></b><br>" & "<br>Thanks!",
{
IsHtml: true,
Importance: "Normal",
Cc: User().Email
}
)