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

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

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
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (63,665)