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 / Show error message whe...
Power Apps
Answered

Show error message when trying to submit a form if required fields are blanked

(0) ShareShare
ReportReport
Posted on by 121

Hi all,

 

I am new to PowerApps and I'm trying to add some data validation into my form entries.

 

There are certain fields in my form which are required for the form to be submitted.

I have managed to get the error message to come up if the required field is blank, but the error is showing constantly. I only want the error to show if the user tries to submit the form with the field empty.

 

Please see below.

The fields that are required - but the error is constantly showing

jolebe09_0-1681975851829.png

This is where I changed the required field.

jolebe09_1-1681975918261.png

I also have a confirmation pop up after clicking the submit button to confirm the user wants to submit the entry, so the error would have to show up after this.

 

The submit button onselect - 

jolebe09_0-1681976218644.png

 

The confirmation popup onselect if yes - 

jolebe09_1-1681976271834.png

 

The confirmation onselect if no - 

jolebe09_2-1681976291853.png

 

 

Thank you in advance.

Categories:
I have the same question (0)
  • Cr1t Profile Picture
    555 on at

    @jolebe09 

    you can add the data validation formula to the "OnSelect" property of the Submit button.

     

    If( IsBlank(DataCardValue4.Text) || IsBlank(DataCardValue5.Text), Notify("Please fill in all required fields."), SubmitForm(EditForm1) )

     

     

    Replace datacardvalue4.text & form name to your datacard names on the form.

     

    Let me know if this works.

     

    Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

     

     

     

  • jolebe09 Profile Picture
    121 on at

    Hi Cr1t, thanks for getting back to me.

     

    I think I wanted to go more into the individual data cards and say something like 

    If(
    !IsBlank(DataCardValue20.Text)
    "Field is required"
    )

     

    And then click the submit button and if the error comes up it stays on the page, but if there is no error you get the confirmation pop up.

     

    Thanks

     

  • Verified answer
    Ramole Profile Picture
    Super User 2024 Season 1 on at

    Hi @jolebe09 
    The form has already that function and will reset the error back to blank on submit if the Required field is filled, if you want to force try adding this OnSelect of the submit button ResetForm(YourFormName) or to check if the required is filled before submit add this on OnSelect of your button

    If( //The required Datacardvalue names 
     !IsBlank(YourDataCardValueName.Text) && !IsBlank(YourDataCardValueName.Text),
     // Add you logic here for example SubmitForm(AccidentForm)
     SubmitForm(AccidentForm);NewForm(AccidentForm),
    
     // This will be shown if the required field is empty
     Notify("Please make sure all fields are filled in correctly ",NotificationType.Error,3000)
    )

     

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard