cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kit1128
Helper III
Helper III

Only one checkbox can be selected

HI GUYS,

 

I've two question about the checkbox

 

1. I want to make the individual checkbox that means only one checkbox can be selected. E.g checkbox A is selected, then checkbox B will uncheck

2. How can clear the checkbox in form when change the page

1 ACCEPTED SOLUTION

Accepted Solutions
eka24
Super User III
Super User III

Try this:

Question1

You can use the DisplayMode of the checkbox:

   checkboxB

  If(checkboxA.Value=true,DisplayMode.Disabled,DisplayMode.Edit)

 

checkboxA

  If(checkboxB.Value=true,DisplayMode.Disabled,DisplayMode.Edit)

 

Question2

OnUnCheck of the CheckBox:

If(ThisItem.ID exactin MyColl.ID,
Remove(MyColl, LookUp(MyColl,ID=ThisItem.ID)))
You can replace ID with any unique column of your table
 

View solution in original post

6 REPLIES 6
eka24
Super User III
Super User III

Try this:

Question1

You can use the DisplayMode of the checkbox:

   checkboxB

  If(checkboxA.Value=true,DisplayMode.Disabled,DisplayMode.Edit)

 

checkboxA

  If(checkboxB.Value=true,DisplayMode.Disabled,DisplayMode.Edit)

 

Question2

OnUnCheck of the CheckBox:

If(ThisItem.ID exactin MyColl.ID,
Remove(MyColl, LookUp(MyColl,ID=ThisItem.ID)))
You can replace ID with any unique column of your table
 

View solution in original post

HI @eka24 ,

Thanks for reply. I think that's not quite what i want, as I just want to ticking one of checkbox, then another checkbox immediately unticks.

eka24
Super User III
Super User III

Are you refering to 1 or 2

------------

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

Hi @eka24 

Referring question1

eka24
Super User III
Super User III

Consider the approach I gave, which will acheive same result, a user cannot check 2 checkboxes at the same time. One has to be unchecked before a new selection could be made.

It also avoids circular referencing.

 

------------

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

@eka24 

Thank you very much for solve my question. 😁

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

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (22,434)