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
Pstork1
Dual Super User III
Dual Super User III

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)  ?

Pstork1
Dual Super User III
Dual Super User III

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. 

View solution in original post

@DustinCooper 

 

thanks a lot! it worked like a champ! 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,427)