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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to display no reco...
Power Apps
Answered

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

(0) ShareShare
ReportReport
Posted on by 76

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? 

 

 

Categories:
I have the same question (0)
  • Verified answer
    Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @PowerPete13 - 

     

    1. Insert a Label control into your Gallery. Set the Height property of the Label to Parent.Height and the Width property to Parent.Width.

     

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

     

    'Your Gallery'.AllItemsCount = 0

     

    3. On the Text property, enter "No Record Found"

     

  • Verified answer
    DJ_Jamba Profile Picture
    2,837 Super User 2025 Season 2 on at

    @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)

    )

  • PowerPete13 Profile Picture
    76 on at

    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. 

  • DJ_Jamba Profile Picture
    2,837 Super User 2025 Season 2 on at

    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

  • Shravyashree_01 Profile Picture
    174 Moderator on at

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

  • Verified answer
    Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @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.

  • PowerPete13 Profile Picture
    76 on at

    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.  

     

     

     

  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

    @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
    76 on at

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

  • Ami K Profile Picture
    15,679 Super User 2024 Season 1 on at

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

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard