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 / ERROR ON SEARCH PANEL
Power Apps
Unanswered

ERROR ON SEARCH PANEL

(0) ShareShare
ReportReport
Posted on by 35

Hello, 

 

I am creating an app which contains a list of school data. Now i was succesful to search the school by its name function on search function but if i am searching for any other thing than the name of school, it is giving me nothing. I want to at least say that the search was not found. My function of filter and search is as follows : 
and my :"Title" = School Name 
SortByColumns(Filter('School Info', StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))

 

Can anyoone please help me to find my answer as soon as possible.

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    Your formula is setup to search only by the Title (which I asume is the school name)

     

    StartsWith(Title, TextSearchBox1.Text)

    If you are interested in just Search read up here on Search() function: https://powerapps.microsoft.com/en-us/tutorials/function-filter-lookup/

     

    Basicallly replace you function with this:

    Search( 'School Info', TextSearchBox1.Text, "Title","OtherColumn","ThirdColumn" )

    It will search those columns to match what you entered into the SearchBox.

     

    To have it say Results not found add Label and in Text function you can do something like this:

     

    If(
     CountRows(
     Search( 
     'School Info', 
     TextSearchBox1.Text, 
     "Title",
     "OtherColumn",
     "ThirdColumn"
     )
     ) = 0,
     "No Results",
     ""
    )

    Replace OtherColumn and ThirdColumn with actual column names in your School Info database.

     

  • Dev Profile Picture
    35 on at

    Hello, 

     

    I used the formula which was last posted but gives me that "the part of search formula cannot be evaluated remotely due to service limitations. The local evaluation may produce suboptional or partial results. If possible please simplify the formula."  

     

    Can somebody please help me asap?

  • Community Power Platform Member Profile Picture
    on at

    That is not an error.

     

    It gives you this info because it cannot delegate the function of retrieving data to the source. Meaning that PowerApps pull all the data and do the operators in PowerApps. It is limited to 500 rows when doing it this way.

     

    You can learn more here: https://powerapps.microsoft.com/en-us/tutorials/delegation-overview/

  • Dev Profile Picture
    35 on at

    Yes, I do agree that this is not an error. It was searching the schools before and now too it searches, But my consern is that if the user typed something wrong or a typo it should have something like : " Results not Found". I need the code for that.  As this is not working, i dont have 500 rows so it should not limit itself from searching and showing  the error message to the user. 

  • Community Power Platform Member Profile Picture
    on at

    There are many ways to achieve the No Results Found text.

     

    Example 1:

    Add Label, Change the Text property to following:

    If(
     CountRows(Gallery1.AllItems) = 0,
     "No Results Found",
     ""
    )

     

    Example2:
    Or add Label, change its text to No Results Found.

    Change the Visible property of the label to:

     

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

    Replace Galery1 with the name of your gallery.

  • JoshHoughton Profile Picture
    73 on at

    Regarding the original question about the issue with the text search, rather than using the Filter command to filter results by the text box, would it not be better to use the Search command? I only tend to use Filter when I want to always filter certain criteria regardless of what text is put in the text box. You can also add additional columns to search if you want to search by other properties than the title (see note)

     

    Here is an example statement...

    SortByColumns(Search('School Info', TextSearchBox1.Text,"Title","<Anotherfield>"),"Title",If(SortDescending1, Descending, Ascending)). 

     

    Where I have put <Anotherfield> you can put in as few or as many other fields as you like by adding a comma and quoting any other fields before the close-bracket, then the gallery will find records that match other types of searches. 

     

    Note: If you are using the Common Data Service, check your entity source table ('School Info') because only fields that are checked as "Searchable" can be used to search with the textbox. If you try to search a field that is not searchable then powerapps may give a warning indicator if you add these fields to your search formula. Also be aware that some types of fields may not be searchable because of a limitation in powerapps. For example, textboxes are searchable but currency is not. 

  • Dev Profile Picture
    35 on at

    Honestly, I have no idea about the common data services of powerapps. So what i have done is i have made a sharepoint online list and i am retrieving all the information in powerapps from sharepoint. I saw that the search delegation is retrieted on sharepoint and even the IsBlank is also limited. Can you please guide me what should be the next appropriate step, as i have less time and publish this app.

  • JoshHoughton Profile Picture
    73 on at

    You can ignore what I said about the Common Data Service if you're using Sharepoint instead. I just made a test app using a Sharepoint List of my own and have checked to ensure that the Search command does indeed work with Sharepoint lists for filtering galleries, but it seems when creating an App from template it automatically uses the Filter command so I had to change the formula slightly. 

     

    If you are just simply wanting to search through a gallery of items from your sharepoint list using a textbox search feature, and it's not any more complicated than that, then try my suggested formula. I'll give you some steps if it helps...

     

    1. In your gallery, you've probably got various text labels for showing different fields of a record correct? (you haven't specified all your fields in your original question so for the sake of an example I'll assume that includes things like the School Name, the address, the postcode, a contact number etc.). Check each of your labels in the Gallery properties menu and you may see that each of your fields have a strange ID code (e.g. OData_X0011_ab1)... make a note of these codes and which field they are referring to. Your School Name field will just be "Title". For the sake of my example, let's say your fields are as follows...

    "Title" = School Name

    "OData__x0011_ab1" = School Address

    "OData__x0099_zy9" = School Postcode

     

    2. To make a gallery that allows me to search for a school using any one of the above search criteria (and sort it alphabetically by the name of the school), I would change my Gallery Items property to the following statement...

    SortByColumns(Search('School Info',TextSearchBox1.Text,"Title","OData__x0011_ab1","OData__x0099_zy9"), "Title", If(SortDescending1, Descending, Ascending))

     

    Powerapps might give a service limitation error but it should still work based on my own test. 

     

    If the text box is blank, then all records will show in the gallery. As soon as you type anything into the textbox, it will search for any school where either the School Name (Title) or School Address (OData__x0011_ab1) or School Postcode (OData__x0099_zy9) matches what is being typed. The good thing about doing it this way rather than using Filter(StartsWith) is that you can type in any part of a school name/address/postcode, not just the beginning of it, even without typing the whole word. This makes searching easier for the app users. 

     

    Hope this helps. 

  • Dev Profile Picture
    35 on at

    I am not seeing any strange id in my gallery properties. Is it possible for you to use teamview and fix my problem.

    I am still able to search the speacific fields if i still use filter, But i want something to be showed up if the user misspelled or the school i snot avaibale, I need to prompt the error message that the school doesnot found. 

  • JoshHoughton Profile Picture
    73 on at

    Unfortunately I don't have team view. I don't know what to suggest in regards to the error message prompt you are receiving as I've never tried to do it... I have gone with the assumption that the user will know that no record is found by the fact that the gallery shows no records. Sorry I wasn't able to help with your problem. 

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard