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 / FormSubmit when requir...
Power Apps
Unanswered

FormSubmit when required fields not complete

(0) ShareShare
ReportReport
Posted on by

I have an app that has a form which is based on a SharePoint list. I have a button that performs the action SubmitForm:

 

     SubmitForm(FrmSelectedRequest);

 

All is fine but if the form has not been completed with all 'required' fields the form submits with an error message. How do I prevent the submit from happening if all the required fields are not complete?

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous,

    You can can use the Display mode property of the  Submit button to do what you require.  If DataCardValue2, 6 and 9 were required, then the formula would be

    If(IsBlank(DataCardValue2) || IsBlank(DataCardValue6) || IsBlank(DataCardValue9), Disabled, Edit)

     Then unless there was data in those three controls, the user could not successfully activate the Submit button.

    As an alternative, you could also hide the Submit button by putting a similar formula into its OnVisible property.  In this case, all three values would have to hold data for the formula to reduce to true and Unhide the button.

    !IsBlank(DataCardValue2) && !IsBlank(DataCardValue6) && !IsBlank(DataCardValue9)

     If this answers your question, please mark the thread as solved.

  • Community Power Platform Member Profile Picture
    on at
    Thank you. I can see that this will work but if the form has lots of fields the formula looks very clunky. I don't understand the purpose of the "Required" property if you can still submit the form when such fields are empty.
  • Dawidvh Profile Picture
    1,346 on at

    Hi @Anonymous 

    I agree with your thoughts and have faced the same problem. We use the EditForm.Valid method to check if the form is valid before submitting. We then use the !Parent.Valid on the asterisk in the cards to show which fields still have to be completed before allowing the submit. 

     

    Please see below video that discusses this in more detail.

    https://youtu.be/7O8HCz37Q0A

     

    Dawid van Heerden
    Follow on Twitter: @davestechtips
    Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1
    **If you found this reply helpful, please mark this as the answer to close the topic and make it easier to find for other people with similar questions. AND we get points for it 😉

  • ElieCSalame Profile Picture
    3 on at

    this is a perfect solution for many required fields

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