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 / Visible Formula for la...
Power Apps
Answered

Visible Formula for label if search returns null

(0) ShareShare
ReportReport
Posted on by 58

I am creating an app that is linked to a SharePoint List.  The employee will be able to fill out a form to request materials.  When the click submit the request is uploaded to SharePoint while the employee will get a confirmation number.  This confirmation number is the SharePoint ID number that is created when the request is uploaded to SharePoint. Then there is a Search Screen where the employee can go to, put in the Confirmation Number (SharePoint ID number) into a search box and then certain items from the list will display.

 

Now my question.....if the search box (label) returns null....meaning if the ID number does not exist, then I want a label to appear with a custom message.  What do I put for the visible formula for the label I want to appear?

 

Categories:
  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @chhamilton34 I suppose the Search Box is a Textinput (and not a Label as you had mentioned). I also believe you'll have a gallery to display the search results of the search. If that be the case, you can set the Visible of the label with a custom message to, 

    CountRows(yourSearchGallery.AllItems)=0

  • chhamilton34 Profile Picture
    58 on at

    You are correct, the Search Box is a Text input box.  Also it is connected to a gallery.

     

    I tried the formula you recommended and it did not work.  I got an error message:

    chhamilton34_0-1627504697872.png

     

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @chhamilton34 Replace 'Test PR List' with the name of your Gallery.

     

     

  • chhamilton34 Profile Picture
    58 on at

    Oh, sorry my mistake....so that did work but only to a point.  If you put in the ID number but then delete that number to search a second number, while the search box is blank the message appears.  I am taking it that what I want the app to do is not feasible?

     

  • Verified answer
    CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @chhamilton34 Do this,

    CountRows(yourSearchGallery.AllItems)=0 && !IsBlank(yourTextInput.Text)

  • chhamilton34 Profile Picture
    58 on at

    OMG it worked....you are a genius!!!!  Thank you so much 🙂

  • CNT Profile Picture
    10,921 Super User 2024 Season 1 on at

    @chhamilton34 Glad to help!

     

    Please remember to give a 👍 and accept the solution as it will help others in the future.

  • Fizie Profile Picture
    2 on at

    Hai Chhamilton,

    how about the search box using id based on a database in list SharePoint?, for example, if I put the null data in id,  and the data is not in the list SharePoint database, how can I show the error message once I clicking the button.

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