cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
chhamilton34
Helper II
Helper II

Visible Formula for label if search returns null

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?

 

1 ACCEPTED SOLUTION

Accepted Solutions
CNT
Community Champion
Community Champion

@chhamilton34 Do this,

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

View solution in original post

7 REPLIES 7
CNT
Community Champion
Community Champion

@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

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
Community Champion
Community Champion

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

 

 

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?

 

CNT
Community Champion
Community Champion

@chhamilton34 Do this,

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

View solution in original post

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

CNT
Community Champion
Community Champion

@chhamilton34 Glad to help!

 

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

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (967)