Skip to main content

Notifications

Community site session details

Community site session details

Session Id : IvU9AhECWo9MmhcygO1tl/
Power Apps - Building Power Apps
Answered

Stop form submission if fields are blank

Like (0) ShareShare
ReportReport
Posted on 10 Feb 2022 16:01:34 by 53

Sorry if this has been posted before. 

 

I have a form linked to a sharepoint list. Im trying to make the forms mandatory and reading around i can use displaymode on the button with this command 

 

If(IsBlank(DataCardValue2) && !IsBlank(Title) && !IsBlank(DateValue3) && !IsBlank(HourValue3) && !IsBlank(MinuteValue3) && !IsBlank(DataCardValue21) && !IsBlank(DataCardValue22) && !IsBlank(DataCardValue25),DisplayMode.Disabled)

 

But its not working. have i done something wrong? 

 

Screen shot
form.jpg

 

 

Thank you in advance 

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 11 Feb 2022 at 15:37:56
    Re: Stop form submission if fields are blank

    @RHADAVE 

    If it is disabled...then users can't click on it!

  • RHADAVE Profile Picture
    53 on 11 Feb 2022 at 15:08:35
    Re: Stop form submission if fields are blank

    Just wondering, is there a command i can use to display a message if the disabled "send request" button is pressed when the form is blank, instead of using a tool tip. Just a friendly prompt if someone has missed something out. It Avoids me getting lots of phone haha

     

    thank you

  • RHADAVE Profile Picture
    53 on 11 Feb 2022 at 11:18:07
    Re: Stop form submission if fields are blank

    OMG!!! IT WORKS!!! Yeeeeeeeeeeeeeeaaaaaaaaaahhhhhhh! 

     

    You have no idea how much i appreciate the help. 

     

    I have never used PowerApps until 2 weeks ago, and its been a steep uphill climb trying to build this. Last bit of coding i touched was visual basic 16 years ago in I.T boot camp! 


  • Verified answer
    C-Papa Profile Picture
    1,836 on 11 Feb 2022 at 11:12:22
    Re: Stop form submission if fields are blank

    This will most likely be because you have not set the other fields as required. the Form7.Valid function is deciding if the form is ready to go, so if for example all fields had required set to false, your button would always be orange / in edit mode, but if all fields were set to required (true) the button will not change to orange / edit mode until the last input value has been filled out in the form. 

  • Verified answer
    RHADAVE Profile Picture
    53 on 11 Feb 2022 at 11:05:10
    Re: Stop form submission if fields are blank

    Hi mate, using

      If(Form7.Valid, Edit, Disabled)

    As soon as i fill in "requester" and "title" the button goes to orange which is the enabled colour... 

  • RHADAVE Profile Picture
    53 on 11 Feb 2022 at 09:04:00
    Re: Stop form submission if fields are blank

    thank you so much. ill give it a try this morning! 

     

    I really appreciate the help 🙂

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 10 Feb 2022 at 17:44:06
    Re: Stop form submission if fields are blank

    @RHADAVE 

    Oh, and noticing that you were using this for the DisplayMode...so the formula would be:

      If(Form7.Valid, Edit, Disabled)

  • RandyHayes Profile Picture
    76,287 Super User 2024 Season 1 on 10 Feb 2022 at 17:05:52
    Re: Stop form submission if fields are blank

    @RHADAVE 

    You need not do all the comparisons (and, you will want to compare the property of the control, not the control - i.e. DataCardValue22.Text, not just DataCardValue22).

    If your field is required in the form, then simply set your submit logic to:

      If(yourForm.Valid, SubmitForm(yourForm))

    It will do all the other comparisons for you.

     

    I hope this is helpful for you.

  • C-Papa Profile Picture
    1,836 on 10 Feb 2022 at 16:39:00
    Re: Stop form submission if fields are blank

    Hi, select the datacard, the select Required from the menu and change to true

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard
Loading started