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 / BUG: Checkbox Visible ...
Power Apps
Unanswered

BUG: Checkbox Visible property always false

(0) ShareShare
ReportReport
Posted on by

Hi,

 

I have a checkbox inside a gallery with a formula set on the Visible property. Based on the Visible status of the checkbox I want to do some logic in the app.

Now, the formula in the property evaluates normally and it shows/hides my checkbox accordingly, but if I try to use checkbox.Visible in other formulas looks like it is always 'false', even when the checkbox is visible on the page.

 

In order to test this I have added a label on the page and I set it's Text property to checkbox.Visible. As you can see below, the checkbox is clearly visible on the page, but the value displayed in the label is 'false':

Label value and checkbox visibleLabel value and checkbox visibleLabel formulaLabel formula

 

My problem with this is that I have to duplicate the formula from the Visible property, adding load on the app and duplicating code... hopefully this can be looked at and fixed in the next releases 🙂 

 

Thanks

Categories:
I have the same question (0)
  • v-monli-msft Profile Picture
    on at

    Hi @Anonymous,

     

    I think this is because that your checkbox is placed in a data card in gallery control. Each card in this gallery will have a checkbox with different status and all of them are treated as checkbox in PowerApps. This is why your Label cannot show the right result with checkbox.Visible.

     

    Regards,

    Mona

  • Community Power Platform Member Profile Picture
    on at

    Hi @v-monli-msft

     

    I am not using data cards... I am using a simple gallery with checkboxes in it. The label I was testing with was also part of the gallery. So I'm not sure I understand why is that correct, considering the checkbox is clearly visible on the page.

     

    Thanks,

     

  • v-monli-msft Profile Picture
    on at

    Hi @Anonymous,

     

    When you insert an control inside a Gallery, it will be inside a data cards. 

     

    Regards,

    Mona

  • Community Power Platform Member Profile Picture
    on at

    Hi @v-monli-msft

     

    I'm sorry, but this still doesn't make any logical sense to me...

     

    Since the PowerApp is capable of evaluating correctly the Visible formula on the checkbox, why is not able to use that value outside of the checkbox?

    You can't have something clearly visible on the page, and when you use that property in another control to return 'false'...

  • tahoon Profile Picture
    on at

    Hi MelindaK,

     

    This seemingly strange behavior is because the Gallery is meant to display lists of items. The elements inside the gallery act as a template and are repeated for each item in the Gallery. To see what I mean, just insert a vertical Gallery.

     

    Back to the case of the Checkbox. Let's say I insert a checkbox in the Gallery, name it ReviewCheckbox, and set Visible to a formula that evaluates to true for odd-numbered items and false for even-numbered items. Outside the checkbox, it's not really clear what ReviewCheckbox.Visible should be, because PowerApps does not know which instance of ReviewCheckbox to use. Is it the ReviewCheckbox of the first item or the second item, etc?

     

    It would be a nice feature to prevent referencing Gallery elements from outside the Gallery. Or have a warning.

     

  • Meneghino Profile Picture
    6,949 on at

    @tahoonis absolutely correct.

    The correct way to reference controls in the gallery template should be either through the .Selected property, like this:

    Gallery1.Selected.ReviewCheckBox.Visible

    Or collectively like this for example:

    Sum(Gallery1.AllItems, If(ReviewCheckBox.Visible, 1, 0))

     

    However, this does not currently work, as only some of the properties of controls are available outside the gallery in this way.

     

    Here is the work around:

    1. Create a blank app
    2. Insert a vertical gallery
    3. Insert a toggle, a check box and a label in the gallery's template
    4. Set the check box's Visible property to
      Toggle1.Value
    5. Set the label's text property to
      Ckeckbox1.Visible
    6. Insert a label outside the gallery and set its text property to this
      Sum(Gallery1.AllItems,If(Label1.Text="true", 1, 0))

    That is all you need, screenshot below, please let me know what you think.

     

    __.JPG

  • Community Power Platform Member Profile Picture
    on at

    Hi guys,

     

    Thanks for the explanation, it somehow makes more sense now.

    The reason why I was confused is that the formula which hides/shows the checkbox validates the same for all the checkboxes in the gallery, so it's not the case when 1st is visible and 2nd is not... is all of them, or none of them.

     

    I have ended up just duplicating the formula outside the gallery... not the best solution but it works.

     

    However, @Meneghino nice solution 🙂 I haven't give it a try, but I believe it definitely works.

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard