Announcements
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 🙂
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! 🍻
@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!
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 393 Super User 2026 Season 2
Mohsin Ali 328
WarrenBelz 278 Most Valuable Professional