cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Ashok2
Level: Powered On

checkbox mandatory field in powerapps

Hi i am working on the form where if i make checkbox  requried field it does not throw submission error while submitting data in powerapps , even the field is mandatory it work for text box and drodown but not for checkbox

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Level 8

Re: checkbox mandatory field in powerapps

Hi @Ashok2 ,
The easiest way is to do a check on your Save button and give a message. I will call the CheckBox Check1 and your form MyForm

If(
   Check1.Value = true,
   SubmitForm(MyForm),
   Notify("you must check the box", NotificationType.Error)
)
   

This will put a red message across the top of the screen instead of saving the form. 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

7 REPLIES 7
Super User
Super User

Re: checkbox mandatory field in powerapps

The thing is how do you define a checkbox being mandatory? If it is unchecked, it could be by choice. There are only two possible outcomes with a checkbox (checked or unchecked) and we cannot say unchecked equates to user not providing a value, as not checking it is a perfectly viable option. If for you, required equates to the user checking the checkbox, you can add some logic to it. Let me know if that is your use case and I can provide more details. 

 

Does that help? 

 

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

 

Thanks!
Hardit Bhatia
https://thepoweraddict.com

WarrenBelz
Level 8

Re: checkbox mandatory field in powerapps

Hi @Ashok2 ,
The easiest way is to do a check on your Save button and give a message. I will call the CheckBox Check1 and your form MyForm

If(
   Check1.Value = true,
   SubmitForm(MyForm),
   Notify("you must check the box", NotificationType.Error)
)
   

This will put a red message across the top of the screen instead of saving the form. 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Super User
Super User

Re: checkbox mandatory field in powerapps

@WarrenBelz

Just want to add that the above logic assumes making the checkbox mandatory = checking the checkbox which, in most case, will not be true or desired.

Which is why, there is no "out of the box" validation for a checkbox even though you can mark it as required.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
https://thepoweraddict.com
WarrenBelz
Level 8

Re: checkbox mandatory field in powerapps

Hi @PowerAddict ,

That is why I made my logic as having to be true to proceed. I assumed that @Ashok2 wanted the user to check a box acknowledging something before saving.

Super User
Super User

Re: checkbox mandatory field in powerapps

Sure thing. I just wanted to make it clear to @Ashok2 that implementing this will force the user to check the checkbox, if that's the desired outcome, then this will be perfect. But if not, there is no way to know that a user has responded to checkbox.
Ashok2
Level: Powered On

Re: checkbox mandatory field in powerapps

Yes its correct if checkbox is not checked it passing the value no which will lead to incorrect information so i changed the behaviour to dropdown which reslove my issue thanks all for your responses

WarrenBelz
Level 8

Re: checkbox mandatory field in powerapps

Hi @Ashok2 ,

If you are wanting an error with no value or false, then the test I did (unless it is true, do not save it but give a message will work.

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,728)