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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Disable button based o...
Power Apps
Answered

Disable button based on checkboxes in a gallery

(0) ShareShare
ReportReport
Posted on by 102

So, I first thought this is easy but then realized it's a bit more tricky than I thought..

I have a gallery, that has a checkbox and what I want to do is, if none of the checkbox has been checked, then the "Create Relationship" button will be disabled.

site1.png
This is my code on the DisplayMode field of the button (Create Relationship):

 

If(chkSelected.Value, Edit, Disabled)

 

chkSelected is the name of the checkbox in the gallery. 

The problem is since "chkselected.value" is referencing all checkboxes within the gallery, if the user checks more than 1 checkbox then uncheck one of those, it'll disable the button.

Is there a way to code it to within that gallery list, if no checkbox is checked, then the button is disabled, but if there is one or more checkbox that is checked, then the button is enabled (Edit mode)?

 

Thanks!

Categories:
I have the same question (0)
  • Verified answer
    yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @MrEdward 

     

    Can you try to use the below expression?

    If(CountRows(Filter(Gallery3.AllItems,Checkbox1.Value = true))>0,DisplayMode.Edit,DisplayMode.Disabled)

    Here, Gallery3 needs to be replaced with the Gallery name.

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • MrEdward Profile Picture
    102 on at

    I actually just found that too, very clever way of doing it. It works - 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard