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

Obligatory field

Hello community! I wanted to ask you how you can make a field mandatory? It would be the equivalent of "Not null" in SQL, but doing it directly in Power Apps. Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
JR-BejeweledOne
Super User
Super User

Power Apps does not currently have the ability to make a field mandatory (This answer does not discuss fields in forms).

 

There are ways to work around this by using Visible and DisplayMode properties of other controls.   What I do is add a 5 point star icon, 15 x 15 and make it red in color.   Then I make its visible property dependent on if the field is empty or not (IsBlank()).

 

ReqField.png

 

I will also set the DisplayMode property of any button that saves, submits or navigates somewhere else also based on whether the 'required' field has data.

 

Like this:

 

 

 

If(
   IsBlank(fieldName), DisplayMode.Disabled,
    DisplayMode.Edit
 )

 

 

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

View solution in original post

3 REPLIES 3
JR-BejeweledOne
Super User
Super User

Power Apps does not currently have the ability to make a field mandatory (This answer does not discuss fields in forms).

 

There are ways to work around this by using Visible and DisplayMode properties of other controls.   What I do is add a 5 point star icon, 15 x 15 and make it red in color.   Then I make its visible property dependent on if the field is empty or not (IsBlank()).

 

ReqField.png

 

I will also set the DisplayMode property of any button that saves, submits or navigates somewhere else also based on whether the 'required' field has data.

 

Like this:

 

 

 

If(
   IsBlank(fieldName), DisplayMode.Disabled,
    DisplayMode.Edit
 )

 

 

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

View solution in original post

RandyHayes
Super User III
Super User III

@Labraham36 

To add to what was mentioned by @JR-BejeweledOne , if you ARE using an EditForm for your data, then simply set the Required property of the datacard with your field to true.

 

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!

Thanks a lot! With that I fix it!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (76,367)