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 / Icon button visibility
Power Apps
Answered

Icon button visibility

(0) ShareShare
ReportReport
Posted on by 133

Hello All 

 

I would like to make an icon button (onselect = navigates to anther page with gallery that displays data in a collection) invisible until the link gallery/collection has a row count >0; basically you are only able to navigate to the page containing the collection data if there is actually any data to view. ...

 

Thank you in advance 🙂

Categories:
  • SpongYe Profile Picture
    5,909 Super User 2026 Season 2 on at

    Hi @BaseHQ 

     

    This is a sample coude that you can use:

    //Button1.Visible 
    If(CountRows(YourCollection) > 0, true, false)

     

    If you have any questions or feedback, please let me know. Have a great day! 😊

    -----------------------
    PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]

    I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    @BaseHQ,

     

    @SpongYe's answer will solve your question.

    As a small improvement to the code: When building If() conditions with true / false as output, you don't need the If statement. This in turn will reduce the amount of code within your application.

     

    //Button1.Visible If statement
    If(CountRows(YourCollection) > 0, true, false)
    
    //Shortened code - output will be true / false:
    CountRows(YourCollection) > 0
    
    //In cases where you want to respond If(condition, false, true) instead of true, false you can use the not operator !
    //Fictive example
    !(1 > 2)

     

    I hope this helps!

  • BaseHQ Profile Picture
    133 on at

    Thank you SpongYe & LaurensM

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
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard