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 / Display a message if n...
Power Apps
Answered

Display a message if no document number found

(0) ShareShare
ReportReport
Posted on by 136

Hello,

 

I have a button and a text field where you enter a document Number and a gallery that returns the Document number and description if it exists.  If the document number dont exist how can I display a message that "No document is found".

 

Isaac

Categories:
  • Verified answer
    PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    Multiple ways you can do it. One way is:

    Add a label with the text that you want. Set ita visible property to:

    If(CountRows(Gallery.AllItems)=0, true, false)

    Let me know if this helps.

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

    Thanks!
    Hardit Bhatia
    The Power Addict
    https://thepoweraddict.com
  • ilanos Profile Picture
    136 on at

    This worked fine.  How do I hide "No documents found" if the Document Number Input field is empty?

  • ilanos Profile Picture
    136 on at

    This issue has been resolved

  • PowerAddict Profile Picture
    7,316 Most Valuable Professional on at
    You can have another button whose visibility is the same as label but this time set their visibility to:
    If(CountRows(Gallery.AllItems)=0 && popVar, true, false)

    Set the popVar variable to true on the OnVisible property of the screen.

    Then the OnSelect of the button can be:
    Set(popVar, false)

    This will hide the label and button.

    One last thing would be to add this to the OnChange property of your text input control where the user is expected to enter a document number.
    Set(popVar, true)

    This will ensure that theis variable resets and is ready to show or hide the popup based on the new document number entered.

    Let me know if this helps.

    ---
    If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

    Thanks!
    Hardit Bhatia
    The Power Addict
    https://thepoweraddict.com

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard