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 / How do you make a fiel...
Power Apps
Answered

How do you make a field required?

(2) ShareShare
ReportReport
Posted on by 6

I don't see a property to make a field required.  What is the best way to check if a field is populated when a user clicks a submit button on a form, and if not populated, highlight fields that need to be populated?  At the very least, I'd like to continue to show a message that required fields are not populated till all of them are.

 

 

Categories:
  • Verified answer
    Brian Dang Profile Picture
    3,976 on at

    Each "card" of the form should have a Required property that you can set to true/false. The same property can be seen for each card in View>Advanced if you select the Form Gallery itself.

     

    The templates provided by PowerApps typically use some form of this code for a Button.OnSelect:

     

    If(!IsBlank(TextInput1.Text) &&
    !IsBlank(TextInput2.Text) &&
    !IsBlank(TextInput3.Text),
    
    SubmitForm(form),
    
    UpdateContext({ShowMessage: true}))

     

    This means that if all of the text input fields are not blank, then the button will Submit the Form. Otherwise, it will change the ShowMessage variable to true.

     

    If the ShowMessage variable is true, a textbox with its Visible property set to the ShowMessage variable will appear with your desired message like, "Please fill out all the required fields."

     

    For more advanced errors besides required fields, I suggest reading up on the Errors function:

    https://powerapps.microsoft.com/en-us/tutorials/function-errors/

     

    You could combine that with the OnSuccess OnFailure properties of the Form.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi,

     

    Property "Is Required" is available, however, it doesnt work as expected.

    I have a field which is required however, calling the Submit form via a button submits it with no issues even though the field in blank

  • Aaronpatel Profile Picture
    38 on at
    Hi,
    @ mr-dang. Thank you for posting the solution. The code you provided for button.OnSelect works great for a few item list. I have a list of over 40 items with app expanding to many pages. Is there a better option? It would be nice if I can just highlight the mandatory fields missing data. I can do that with a text input. But my app has drop-down and branching questions. Any help is appreciated!
  • Mr-Dang-MSFT Profile Picture
    Microsoft Employee on at

    Aaron, if you're using a form, you can just use

    Form1.Valid

    It returns true/false. It checks that all required fields are filled out.

     

    Using it in a condition:

    If(Form1.Valid,DisplayMode.Edit,DisplayMode.Disabled)

    This means, "If Form1 is valid, make the button usable, otherwise disable it."

  • AaronPatel1 Profile Picture
    2 on at

    @mr-dang, Thank you for your suggestion.  I applied similar logic.  I marked the field as required (Required = true) and then added a Nofity(" ",Error) OnFailure and Navigate to the next screen OnSuccess. 

    Required_Field.jpg
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @Mr-Dang-MSFT Re:Using this in a condition

     

    What value would you put this against? OnSelect?

  • MK1 Profile Picture
    169 on at

    @mr-dang,

     

    Can you help me with how to make lable,dropdown, textinput feilds  on a gallery screen required, whilie submitting the form.

     

    Thanks,

    MK1

  • Mr-Dang-MSFT Profile Picture
    Microsoft Employee on at

    @Anonymous, since the condition returns true or false, you can place it in many different places depending on how you want your experience. Below are the two most logical locations:

    • DisplayMode: you can use the condition to disable a button that submits a form
    • OnSelect: you can wrap the condition around the set of actions 
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi,

     

    Can you perform this if  you have just a sheet with TextInputs? i.e no forms?

    how will I handle errors where TextInputs have no data on Submission

     

    Thanks

     

    Dan

  • SHSAHNI Profile Picture
    Microsoft Employee on at
    Hi, I have to make the fields mandatory i.e text input and drop downs. I'm not using forms. I'm using the a regular scrollable page which submits the data when I choose the tick icon. How to proceed in that case?

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 224 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 126

Last 30 days Overall leaderboard