cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PivotMananger
Helper I
Helper I

disable multiple check on checkboxes with three results

Im using my Checkboxes  to validate data to my CDS. 

This already works like a charm but unfortunately you can click both boxes.

But there should be only three options:

 

* Left box is checked (1:0)

* Right box is checked  (0:1)

* Both boxes are unchecked (0:0)

 

 

 

        KlappenFunktion: If(
            KlappenFunktionIO.Value = true;
            KlappenEingestelltIO.Value;
            If(
                KlappenFunktionNIO.Value = true;
                KlappenFunktionNIO.Value;
                ""
            )
        );

 

 

This is how im Saving my Value.

So there is always a priority: LeftBox > RightBox > Unchecked

 

My goal is to disable the possibility to check both boxes at the same time.

I only want to use checkbox elements.

1 ACCEPTED SOLUTION

Accepted Solutions
PowerAddict
Super User
Super User

Hi, 

 

You need to control the DisplayMode of each Checkbox based on the other's value. For example, I have two checkboxes Checkbox1 and Checkbox2. 

 

DisplayMode of Checkbox1 = If(Checkbox2.Value, DisplayMode.Disabled, DisplayMode.Edit)

 

DisplayMode of Checkbox2 = If(Checkbox1.Value, DisplayMode.Disabled, DisplayMode.Edit)

 

It basically checks if the value of the other checkbox is true, if it is, then it disables the checkbox. Please let me know if this works for you. 

 

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

Hardit(Haman)

View solution in original post

6 REPLIES 6
PowerAddict
Super User
Super User

Hi, 

 

You need to control the DisplayMode of each Checkbox based on the other's value. For example, I have two checkboxes Checkbox1 and Checkbox2. 

 

DisplayMode of Checkbox1 = If(Checkbox2.Value, DisplayMode.Disabled, DisplayMode.Edit)

 

DisplayMode of Checkbox2 = If(Checkbox1.Value, DisplayMode.Disabled, DisplayMode.Edit)

 

It basically checks if the value of the other checkbox is true, if it is, then it disables the checkbox. Please let me know if this works for you. 

 

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

Hardit(Haman)

View solution in original post

@PowerAddictWhat if you have 10 checkboxes? I tried using your formula

DisplayMode of Checkbox1 = If(Checkbox2.Value, DisplayMode.Disabled, DisplayMode.Edit) & If(Checkbox3.Value, DisplayMode.Disabled, DisplayMode.Edit)

DisplayMode of Checkbox2 = If(Checkbox1.Value, DisplayMode.Disabled, DisplayMode.Edit) & If(Checkbox3.Value, DisplayMode.Disabled, DisplayMode.Edit)

DisplayMode of Checkbox3 = If(Checkbox2.Value, DisplayMode.Disabled, DisplayMode.Edit) & If(Checkbox1.Value, DisplayMode.Disabled, DisplayMode.Edit)

 

But it doesnt work for me 😞

Actually I just simplified the process..

 

On the oncheck property of the checkbox I reset the other checkboxes.. like this:

 

Reset(WirelessOutageCheckbox);Reset(WirelessCheckbox);Reset(ServerMaintCheckbox);Reset(PowerOutageCheckbox);Reset(PowerMaintCheckbox);Reset(NetworkMaintCheckbox);Reset(InternetMaintCheckbox);Reset(InternetOutageCheckbox); Reset(NetworkDeviceOutageCheckbox)

Traconis
Frequent Visitor

But what to do if I got only one checkbox? The data is taken from the SharePoint list so there is only one checkbox control in the UI. That mean I can't validate its contents based on the other checkboxes. 

Can you provide an example?You should still be able to validate based on the checkboxes even if only 1 has data taken from SP list.

Traconis
Frequent Visitor

Hi Leslie,

 

as you can see on the UI below each entry is the item taken from the SharePoint list using filtering:

Traconis_0-1638374881266.png

But in  the App builder this is a single set of controls i.e. label for the bold code on the left (i.e. 3b2, some other text and the checkbox).

 

The problem is when app filters lists items it may find more than one (in fact it should because it filtering out all available workstations) however in the app builder I can only edit a single checkbox control so trying to figure out a function for onCheck and onUncheck as well as OnSelect to somehow disable checking more than one box at the same time.

 



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!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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