Hi, I have form app in powerapp. Some of the datacard fields are set to required fields and show error when hit on submit button when if any of the field is empty. Later I added an extra datacard (Lets say X) and set its property to mandatory. So while testing, when the X datacard was left empty, the form is still submitting. But all the datacards if left empty showing error. Can someone hlp me in resolving it.
Thanks
This the patch fn i used on submit button
If(
IsEmpty(
Errors(
'TMAS',
Patch(
'TMAS',
Defaults('TMAS'),
{
Title: NameField.Text,
'Instructor Local': LocalField.Text,
'Instructor E-mail': Email.Text,
'Department Chair Name':DepChairName.Text,
'Employee ID Number':EmployeeIDNumberField.Text,
'Course Name': Concat(CourseNameComboBox.SelectedItems,Simple),
'Employee Role':EmployeeRoleComboBox.Selected,
'Other Info': OtherInfoField.Text,
'Employee Role(Other)': DataCardValue1.Text (This the datacard that I have added later)
}
)
)
),
Notify(
"Crs Enroll Request.",
NotificationType.Success
);Office365Outlook.SendEmail("abc@gmail.com","Crs Enroll Request: "&NameField.Text&" - "& EmployeeRoleComboBox.Selected.Value
,HtmlText1.HtmlText,{Cc: Email.Text& " ,Bcc:"xyz@langara.ca", IsHtml:true});Office365Outlook.SendEmail("abcd@gmail.com;xcvbh@gmail.com","e-mail subscription","subscribe address="&Email.Text);Navigate(SubmitScreen,ScreenTransition.Fade);,
Notify(
"Please complete all the required fields.",
NotificationType.Error
)
)