cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper II
Helper II

Re: How do you make a field required?

Hate to revive an outdated thread, but I do not see a Required option anywhere on my Text Input boxes.

Nothing here:

BillKern_0-1594328195745.png

Nothing here:

BillKern_1-1594328236708.png

 

 

Have they removed this option? Or is it not available to me for some reason? Here is my tree view if that helps:

 

BillKern_2-1594328324785.png

 

Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@BillKern 

In all my years I've never seen a Required property on a TextInput control.  I believe you might be confusing with the Required property that is found on a DataCard in a Form control.  The required property on the DataCard plays into the logic for the Form Validation.

 

TextInput controls by themselves do not have a Validation capability.  Making a TextInput control required is part of your OWN logic for validation. 

Ex. Setting a "submit" button to disabled if the TextInput control is blank.  Showing a "Required" label if not filled in, etc.

But these are all part of your own logic.

 

If you want a Required control, it would need to be in a Component capable of Validation.  The only one that comes to mind is a Form Control.

 

I hope this is helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

3 REPLIES 3
Power Apps
Power Apps

(I moved this message to its own topic so your question is not buried at the bottom of a thread)

 

The Required property is available in the Form control. If you have a form, each data card will be required if the underlying data source has that field required. You can also force a data card to be required by setting its Required property to true and it will only be required in the given app.

 

The form control in Power Apps handles the requirements without any additional work on your part besides flipping the property true/false. An error will appear in the form automatically if the user attempts to SubmitForm without filling out the required field.

 

If you want to require a field outside of a form, you can create this experience by wrapping a condition around the action you want.

For instance, suppose you have a button that has an action OnSelect to patch some data. You can use a condition like this to require a value in the text box:

If(
    !IsBlank(Trim(TextInput1.Text)),
    Patch(...)
)

 

This means, "Trim the spaces in the text input box. If the result is not blank, then patch the data (or do whatever action you want)."

 

Let me know if this helps.

 

Super User III
Super User III

@BillKern 

In all my years I've never seen a Required property on a TextInput control.  I believe you might be confusing with the Required property that is found on a DataCard in a Form control.  The required property on the DataCard plays into the logic for the Form Validation.

 

TextInput controls by themselves do not have a Validation capability.  Making a TextInput control required is part of your OWN logic for validation. 

Ex. Setting a "submit" button to disabled if the TextInput control is blank.  Showing a "Required" label if not filled in, etc.

But these are all part of your own logic.

 

If you want a Required control, it would need to be in a Component capable of Validation.  The only one that comes to mind is a Form Control.

 

I hope this is helpful for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

@RandyHayes Thank you for the clarification. I did end up adding this to my submit button and works as I intended.

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (6,855)