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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Required fields are no...
Power Apps
Answered

Required fields are not highlighted when trying to submit a form

(0) ShareShare
ReportReport
Posted on by 20

Hi,

 

I have this code which does not highlight which required fields need entering when you try to submit the form. I thought it highlights automatically but it is just showing my error message. Why might this be?:

If(
NewForm.Valid,
// The form is valid, submit it
SubmitForm(NewForm);
Notify("The program was successfully added! You can find your program by navigating to the home screen and selecting the view/update program", NotificationType.Success, 0);
ResetForm(NewForm); // This line will clear the form
Navigate(Home), // Replace "HomeScreen" with the name of your Home screen
// The form is not valid, show an error message
Notify("Please fill in all required fields.", NotificationType.Error)
)

 

 

Thanks,

Jamie

Categories:
  • AJ_Z Profile Picture
    3,711 Super User 2024 Season 1 on at

    I believe the issue you are facing related to the form validation behavior you're describing usually involves highlighting required fields that haven't been filled in when a user attempts to submit the form. From your code snippet, it seems like you're using the Valid property of the form to check if all required fields are filled in before submitting the form. However, your current implementation only shows a notification message when the form is not valid, without specifically highlighting the required fields that are missing. 

    So you can either submitform and handle the notifications with the OnSuccess Property of the form which I would recommend or do something else to highlight the fields

     

  • jb2023 Profile Picture
    20 on at

    Hi,

     

    Do I just post the same code into OnSuccess on the form?

     

    Thanks,

    Jamie

  • Verified answer
    AJ_Z Profile Picture
    3,711 Super User 2024 Season 1 on at

    close so your onselect should just be the submitform for the button, Next for the form the onsuccess should be:

    Notify("The program was successfully added! You can find your program by navigating to the home screen and selecting the view/update program", NotificationType.Success, 0);
    ResetForm(NewForm); // This line will clear the form
    Navigate(Home), // Replace "HomeScreen" with the name of your Home screen

    and the on failure should be this:
    Notify("Please fill in all required fields.", NotificationType.Error)

  • jb2023 Profile Picture
    20 on at

    Thanks,

     

    And if there is an error it should stay on the form?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard