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 a button based...
Power Apps
Unanswered

Disable a button based on a value that is in a gallery

(0) ShareShare
ReportReport
Posted on by 111

I have a button on the page and I need to disable it if a certain item in the gallery is different from empty

 

Example:

if(IsEmpty(ThisItem.Name) = false; set(varDesablebtn;true);set(varDesablebtn;false))

 

If no value is returned, then I enable the button to add a new one, if it already has a value, it does not show the button.

 

But I'm having trouble because this button is not inside the same gallery as the Name attribute

 

How could I disable this button that is outside the gallery where is the value that I will need to read?

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

    Hi @JasonCastro ,

     

    You could try:

     

    If(
     IsEmpty(Filter(NameGallery.AllItems,IsBlank(Name))),
     true,
     false
    )

     

    As long as NameGallery has an item with an empty Name, this formula will return false.

     

    Best Regards,

    Bof

  • JasonCastro Profile Picture
    111 on at

    Thx for your help!

    But look at this example, in the situations where I put the red circle the button was not supposed to appear, based on logic.

    By logic, if everything is empty, it shows, if not, it doesn't show

     

    In these situations, the "IsEmpty" of these attributes is always returning false

     

    btn.PNG

     

     

    If(
     IsEmpty(
     Filter(
     Gallery4.AllItems;
     IsBlank(RESULT)
     )
     ) And IsEmpty(
     Filter(
     Gallery4.AllItems;
     IsBlank(OP)
     )
     ) And IsEmpty(
     Filter(
     Gallery4.AllItems;
     IsBlank(INTERVAL)
     )
     );
     true;
     false
    )

     

     

    Is there something wrong in the logic that I'm not noticing or is it in the way of doing the search?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 893

#2
Valantis Profile Picture

Valantis 571

#3
11manish Profile Picture

11manish 482

Last 30 days Overall leaderboard