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 Apps
Answered

Search Box Help!

(0) ShareShare
ReportReport
Posted on by 51

I recently had to relocate my sp list from one sp to another, and now my search function no longer works. The code will not work in any way I have tried it. 

 

This is the way it was working before:

 

Sort(Search('New Phone Book List',SearchBox.Text, "Emp Name", "Service", "Phone", "Title", "Keywords"),"Emp Name", Ascending)

 

The sort portion of the code is working, and the data will populate into the gallery when only this portion is input. 

Sort('New Phone Book List',"emp Name",Ascending)

 

When I try to put only the search function, no data will populate in the gallery.

 

I also tried it this way with no success:

Sort('New Phone Book List',"emp Name",Ascending);Search('New Phone Book List',SearchBox.Text,"Emp Name", "Service", "Phone", "Title", "Keywords")

 

Any advice? Thank you!

 

SShulaw_0-1669136499553.png

 

Categories:
I have the same question (0)
  • C-Papa Profile Picture
    1,836 on at

    Hi, it looks like the database is recognised but the column names are not, apart from title (which is default). Did you change the column names in the new list? If the match, try going to your connection and right click and press refresh

  • SShulaw Profile Picture
    51 on at

    The name column was changed from "Name" to "Emp Name", but I reflected that in the code. So I am not really sure why it is not recognizing the column names. 

  • Verified answer
    Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @SShulaw 

    Welcome to SharePoint h3ll!  https://powerusers.microsoft.com/t5/Power-Apps-Community-Blog/The-Ten-Commandments-of-SharePoint-in-PowerApps/ba-p/848842 .  Check out #6

    In any event Search and "in" are not delegatable in SharePoint. For your problem, I suggest

    Filter('New Phone Book List', StartsWith(Title, SearchBox.Text) || StartsWith(Service, SearchBox.Text)....etc)

  • SShulaw Profile Picture
    51 on at

    I see.... Let me try to change that back and see what happens. 

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @SShulaw 

    Changing it back may not work.  SharePoint "remembers" the original column names as well as the Display name that you change it to.  My suggestion is to start again with a new list, leave out spaces in the column names as well as the name of the list, Use only single line of text, numbers and data/time type columns.  Then import the data into the new list. Then, import the list into PowerApps. 

  • SShulaw Profile Picture
    51 on at

    building a new list with the original names did not work either

  • SShulaw Profile Picture
    51 on at

    So I got this to partially work. 

     

    Filter('New Phone Book', StartsWith(Title, SearchBox.Text) || StartsWith(Service, SearchBox.Text) || StartsWith('Employee Name',SearchBox.Text) || StartsWith(Phone,SearchBox.Text) || StartsWith(Keywords,SearchBox.Text))

     

    I had to change the name of my "Name" column (I know, rule 6). But there was another column named "Name {Name}" according to powerapps. So, that string above works however, not exactly how the original search string did. 

     

    Is it possible to make this search a partial match? i.e. it is currently finding John Smith if I type in John, but will not find him if I type in Smith because it is going off what the name (or number) starts with. 

  • SShulaw Profile Picture
    51 on at

    Filter('New Phone Book', SearchBox.Text in 'Employee Name' || SearchBox.Text in Phone || SearchBox.Text in Keywords || SearchBox.Text in Title || SearchBox.Text in Service)

     

    Final Code

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @SShulaw 

    It depends on how many items are in your list.  If it will never exceed 2k, you can make a collection from the list and use that with the Search function or the "in" operator.  If it will exceed 2k, check @WarrenBelz 's blog Practical PowerApps for work arounds. 

    FYI: Name is a reserved word in PowerApps so never name a name column "name".

  • SShulaw Profile Picture
    51 on at

    Thanks @Drrickryp , you earned your cape today!

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

#2
Kalathiya Profile Picture

Kalathiya 361

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 339 Super User 2025 Season 2

Last 30 days Overall leaderboard