web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : 9bIdmZfldadYPwSXAZ7ue5
Power Apps - Building Power Apps
Answered

How to display no record found message after a textinput string search is negative

Like (0) ShareShare
ReportReport
Posted on 1 Mar 2024 21:01:16 by 72

Colleagues -

 

Need a little guidance on the best method/procedure to display a "No Record Found" message after a user conducts a gallery search through a text input string search that did not return a result. Is there a setting on the gallery itself that can display this? Or I do need to add a textlabel "No Record Found" and write an If(Statement) for its Onvisible properties? If that is the case any formula recommendations for that? 

 

 

  • PowerPete13 Profile Picture
    72 on 08 Mar 2024 at 23:35:47
    Re: How to display no record found message after a textinput string search is negative

    This is what is on the items property. I am using Filter() for delegation reasons -  as the datasource is a sharepoint list. 

     

    Filter(
    'DataSourceName',
    StartsWith(
    'License Plate',
    VehicleSearchQuery
    ) || StartsWith(
    'Permit Number',
    VehicleSearchQuery
    ) || StartsWith(
    'First Name',
    VehicleSearchQuery
    ) || StartsWith(
    'Last Name',
    VehicleSearchQuery
    )
    )

  • Ami K Profile Picture
    15,665 Super User 2024 Season 1 on 06 Mar 2024 at 22:50:31
    Re: How to display no record found message after a textinput string search is negative

    @PowerPete13 - please could you share what you have in the Items property of your Gallery (as text).

  • PowerPete13 Profile Picture
    72 on 06 Mar 2024 at 20:00:13
    Re: How to display no record found message after a textinput string search is negative

    Amik That is correct. Maybe there is a better way to achieve this. 

  • Ami K Profile Picture
    15,665 Super User 2024 Season 1 on 06 Mar 2024 at 00:58:01
    Re: How to display no record found message after a textinput string search is negative

    @PowerPete13 - if we just focus on what you're trying to do, rather than whatever solutions you have already implemented - as I understand it:

     

    You want to the Gallery to become visible IF a match has been found from a case-insensitive search.

     

    If a match is not found, the "No record found" label overlaid in front of your Gallery becomes visible.

     

    Is that correct?

  • PowerPete13 Profile Picture
    72 on 05 Mar 2024 at 18:08:55
    Re: How to display no record found message after a textinput string search is negative

    The no record found portion of this works very well Imran-Ami Khan and is a great solution. But I am really trying to only show the matching search results (not the entire gallery), so the user doesn't accidentally select the wrong record.

     

    From a freshly loaded screen this procedure works but after a search has been conducted and the user clicks the search box cancel icon I implemented - utilizing Set(SearchVariable,""); Reset(PlateSearchInput_1) on its on select property, the entire gallery record shows on screen for some reason. 

     

     đꤔ I am using Filter() in the items property of the gallery as the datasource is a sharepoint list. 

    Here is the complete process I am trying to achieve. 

     

    1. Gallery is hidden until search is conducted. 

    2. Gallery only shows search results relevant that are not case sensitive. 

    3. If search does not produce record, "No record found" text label is displayed.

    4. If user selects cancel icon in the search box, text in the search box is cleared and the gallery is hidden once again.  

     

     

     

  • Verified answer
    Ami K Profile Picture
    15,665 Super User 2024 Season 1 on 03 Mar 2024 at 22:32:53
    Re: How to display no record found message after a textinput string search is negative

    @PowerPete13  - apologies. There is a mistake/a key step missing in my instructions. 

     

    1. Create a Container

    2. Cut and Paste your Gallery control into that Container

    3. Set the Height property of the Gallery control to "Parent.Height", and the Width property of the Gallery control to "Parent.Width".

    4. Insert a Label control into the Container. Set the Height property of the Label to Parent.Height and the Width property to Parent.Width.

    5. On the Visible property of the Label, enter:

     

    'Your Gallery'.AllItemsCount = 0

     

    6. In the Tree view, position the Label control in above/in front of the Gallery control.

  • Shravyashree_01 Profile Picture
    174 Moderator on 03 Mar 2024 at 17:56:50
    Re: How to display no record found message after a textinput string search is negative

    You can set the visiblity of the gallery to : !(TextLabel_NoRecordFound.Visible)

  • DJ_Jamba Profile Picture
    2,828 Super User 2025 Season 2 on 02 Mar 2024 at 22:21:55
    Re: How to display no record found message after a textinput string search is negative

    I think you want to hide the gallery until search text is entered in the box, but the text in the search box could still yield no results which means you would display an empty gallery.

    Why don't you display the gallery only when there are results?
    In the visible property of the gallery:
    Self.AllItemsCount > 0

  • PowerPete13 Profile Picture
    72 on 02 Mar 2024 at 22:16:17
    Re: How to display no record found message after a textinput string search is negative

    It works, however, I am experiencing displays issues with it as I am using this formula: If(IsBlank(VariableName), false,true) on the Visible Property of the gallery to hide the gallery until text is entered and searched for in the searchbox control connected to the gallery. Any work arounds you can suggest. 

  • Verified answer
    DJ_Jamba Profile Picture
    2,828 Super User 2025 Season 2 on 02 Mar 2024 at 17:22:56
    Re: How to display no record found message after a textinput string search is negative

    @Amik solutions should work.

     

    Or you can change the fill or border color of the text input control to red and then Notify
    Fill or Border color Property of the text control:
    If(
       And(
        !IsBlank(Self.Text),

        Gallery.AllItemsCount = 0

      ),

       Color.Red,

       Color.NormalColor

    )

     

    Onchange property of the text control:

    If(
       And(
        !IsBlank(Self.Text),

        Gallery.AllItemsCount = 0

      ),

      Notify("No records found from search string: " & Self.Text, NotificationType.Error, 3500)

    )

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

Telen Wang – Community Spotlight

We are honored to recognize Telen Wang as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473