cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rajkumar88
Post Partisan
Post Partisan

how to limit to selection of check boxes max to 3?

Hello Everyone,

 

Do any one know how can below scenario be achieved. 

 

I have a  screen with 19 checkboxes. Based up on the selection it will update the column in SharePoint list. This part is working as I Expected. 

But the issue is that users can select all the checkboxes and I am not able to limit it to any 3 or max 3 only. 

Any help on this one please?

18 REPLIES 18

That's why I suggested disabling the submit button instead.  That leaves the checkboxes open to be checked or unchecked, but the user can't submit until they have 3 or less checked.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

@DustinCooper  

 

For display mode you mentioned is not taking any affect at all. I am still able to select all the 4 or 5 checkboxes and can able to submit that.

@Pstork1 

 

If I understand currectly, implement all of your code as per previous post and also make "submit" button visible=false or visible property=if(checkboxes>3,true,false)  ?

You don't need to do anything with Visible.  The DisplayMode property I specified in my code takes care of it.

And this in the Display Mode property for the button

If(checkedBoxes > 3,DisplayMode.Disabled,DisplayMode.Edit)

The button is disabled (greyed out)  if you choose more than 3 checkboxes. 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

@Pstork1 

 

thanks for the clarification. not sure if there is anything with the code that I applied. seems to be not working. I can still see the "save" button even after selecting more than 3 checkboxes. Save is not greyed out/disbaled. 

@rajkumar88  Can you provide the code from your Checkboxes? The difference between the method @Pstork1 and I suggested would depend on your users. If I took his approach which I prefer, I would get emails about the form not working correctly. But either method should accomplish your goal. 

@DustinCooper @Pstork1 

 

Here you go. 

 

1. on App start : Set(Checkboxes,0)

2. for each checkboxes oncheck property: Set(Checkboxes,Checkboxes+1)

3.for each checkboxes UNcheck property: Set(Checkboxes,Checkboxes-1)

4.  on a text label → visible property →If(Checkboxes > 3,true,false)

5. on "Save" button →DisplayMode →If(Checkboxes> 3,DisplayMode.Disabled,DisplayMode.Edit)

 

FYI → I have "4 checkboxes" created for this scenario. 


@rajkumar88 wrote:

@DustinCooper @Pstork1 

 

Here you go. 

 

1. on App start : Set(Checkboxes,0)

2. for each checkboxes oncheck property: Set(Checkboxes,Checkboxes+1)

3.for each checkboxes UNcheck property: Set(Checkboxes,Checkboxes-1)

4.  on a text label → visible property →If(Checkboxes > 3,true,false)

5. on "Save" button →DisplayMode →If(Checkboxes> 3,DisplayMode.Disabled,DisplayMode.Edit)

 

FYI → I have "4 checkboxes" created for this scenario. 


Remove the DisplayMode. as I have shown above, and it should disable the button. 

@DustinCooper 

 

thanks a lot! it worked like a champ! 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,152)