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

Select single checkbox within a Gallery

 

I have a gallery that references available desks from a SharePoint List and displays them all in a list. When a user selects on the check box next to the desk, it sets that as the chosen desk. All works great

 

Issue I have is that a user can select the checkbox next to any / all available desks if they want to. It always sets the chosen desk to be the last one they selected (and displays the chosen desk to the side along with date and user) but ideally if they select Desk A, they will not be able to select Desk B until they have deselected Desk A

 

Is this possible to do with galleries? Or do we just need to accept that is how they work and live with the fact that they will get a desk and it is showing them the desk name before they navigate to the next screen?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User III
Super User III

@JBMac 

Here is what you can do...

Create a label OUTSIDE of your gallery - let's call it lblCheckCount (you can make it not visible).

Set the Text property of the Label to : CountRows(Filter(yourGallery.AllItems, yourCheckBox.Value))

Now, for the checkboxes in your Gallery, set the DisplayMode to the following:

   If(Self.Value || (Value(lblCheckCount.Text)=0), DisplayMode.Edit, Disabled)

 

This will disable all the other Checkboxes if one is Checked.  If the checkbox is then unchecked, all will become available to check another.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

2 REPLIES 2
Super User III
Super User III

@JBMac 

Here is what you can do...

Create a label OUTSIDE of your gallery - let's call it lblCheckCount (you can make it not visible).

Set the Text property of the Label to : CountRows(Filter(yourGallery.AllItems, yourCheckBox.Value))

Now, for the checkboxes in your Gallery, set the DisplayMode to the following:

   If(Self.Value || (Value(lblCheckCount.Text)=0), DisplayMode.Edit, Disabled)

 

This will disable all the other Checkboxes if one is Checked.  If the checkbox is then unchecked, all will become available to check another.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

👏

 

Worked a treat, thank you @RandyHayes 

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (8,019)