web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Select single checkbox...
Power Apps
Unanswered

Select single checkbox inside a Gallery

(0) ShareShare
ReportReport
Posted on by 4

I have a gallery that show different alternatives for the user to select one. These options comes from another table.  I would like to make the checkbox in a way that user can only select one.  None of the methods I saw worked for me. Any suggestions?

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @MiracleMan 

    It sounds like you want a Radio control. ref. https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-radio 

  • MiracleMan Profile Picture
    4 on at

    Can it be done with a Radio control? I tried but I wasnt able to figure out how the assign the field to the radio.

     

    Also, I did the radio thing (living the default text) and it allowed me to click all of them.

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @MiracleMan 

    You would do it similar to how you use a dropdown control, either hard code the choices like ["Choice1", "Choice2", etc] or you can use Distinct(yourdatasource, yourselectedcolumn) as the Items property.  If you are using it to display choices in a Gallery, set the Default property of the Radio control to the Item as

     

     LookUp(yourdatasource, ID = ThisItem.ID, yourselectedcolumn)

     

    Annotation 2020-06-01 121046.png

  • Verified answer
    v-siky-msft Profile Picture
    on at

    Hi @MiracleMan ,

     

    You can achieve the single checkbox by a Gallery.

     

    First, add a nested gallery2 inside the gallery1, set the Gallery2.Items to another table you mentioned. Then add a checkbox into gallery2, set Text property to ThisItem.ColumnName.

     

    Next, configure the single-check function. Since the gallery can only be single-selected, set Checkbox.Default property: ThisItem.IsSelected, when the gallery item is selected, the checkbox is also checked. 

     

    However, It was found in the test that there were some conflicts between checkbox and Gallery Item, it didn't work as expected.

    The workaround is here: Add a Blank Label into Gallery2, to be front of the checkbox, And set the Visible property: !ThisItem.IsSelected || !Checkbox1.Value. Use Label to avoid the selection conflict between the checkbox and Gallery Item. 

    Here we go.

    GIF_77.gif

    Hope this helps.

    Sik

     

  • BHR Profile Picture
    55 on at

    Hi @v-siky-msft ,

     

    I have gone through your solution it's working in a way but for selecting one checkbox its taking  two mouse clicks. Could you please help me on this.

     

    Thanks in advance.

  • humherahi1 Profile Picture
    2 on at

    by fault I am getting 1 checkbox as checked. I want to have all checkbox as unchecked by default. Can you please guide me how to achieve this.

  • Vishnu_1812 Profile Picture
    2 on at

    How to use one checkbox at a time inside the Gallery. If i choose one among two checkboxes, other box should be unchecked automatically.

  • a68505175 Profile Picture
    10 on at

    Hi @v-siky-msft Your solution work just fine but now the OnCheck and OnUncheck property of check box is not working at all

  • a68505175 Profile Picture
    10 on at

    Your solution work just fine but now the OnCheck and OnUncheck property of check box is not working at all. If the checkbox is checked i need to collect the checked item into check box but when i check the check box its value flip to true but collection is not collecting any value. Can you help ? 

    For Further details see :https://powerusers.microsoft.com/t5/Building-Power-Apps/Checkbox-On-Check-and-On-Un-Check-in-nested-gallery-not-working/m-p/1528797 

  • liutao125632 Profile Picture
    2 on at

    How to understand ''configure the single-check function", could please exlain further? thanks

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard