web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Required field isn't w...
Power Apps
Unanswered

Required field isn't working

(0) ShareShare
ReportReport
Posted on by 85

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
)
)

Categories:
I have the same question (0)
  • v-hanytian-msft Profile Picture
    Microsoft Employee on at

    Hi @kmanakonda ,

     

    According to your Formula, we deduce that 'Employee Role(Other)' in the Data Source is not Required.

     

    If you want to make DataCardValue Required, you can set Required to True of DataCard.

    vhanytianmsft_0-1693790772105.png

     

    Or you can try this Formula.

    If(
     !IsBlank(
     DataCardValue1.Text
     ),
     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
    )
    )

    Hope this will help you,

    Best Regards,
    Tina

     

  • kmanakonda Profile Picture
    85 on at

    Hi thanks for the response,

     

    my question is Email.Text is also a mandatory field just like DataCardValue1.Text, why when Email.Text is throwing up an error where as DataCardValue1.Text is not even when required field is set tot true? Let say if use you the patch you recommended, but what If I add another DataCardValue2.text in future?  How do we solve this

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard