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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / SearchBox Query Code I...
Power Apps
Answered

SearchBox Query Code Issue.

(0) ShareShare
ReportReport
Posted on by 519

Hello,

 

I have built a search box, i think there is an issue with my code, because when searching i need to type in the full name exactly as written to return the results, when I would like to start typing the name and it will return the results, please may you help me achieve this outcome? Here is my code below:

AndyPowerAppNew_0-1672910100699.png

 

The Name column in the SP is a Single line of text.

 

Is there a way of not showing anything on screen until the user starting typing in the textbox, would be better if they didnt see a list until started typing.

 

Thank you

 

Kind Regards

Categories:
  • victorcp Profile Picture
    2,350 Moderator on at

    Hi,

    When you use Filter the condition must be true as you are using "'Name (FirstName)'= TextInput1.Text" it must be equal, I suggest using Search or StartsWith, like this:

    Search(Visitorentrylist,TextInput1.Text,"Name (FirstName)")

    or

    Filter(Visitorentrylist,StartsWith('Name (FirstName)',TextInput1.Text))

     

     

     

     

  • AndyPowerAppNew Profile Picture
    519 on at

    Hi @victorcp ,

    Thank you, i have used the second formula, as below;

    AndyPowerAppNew_0-1672914813533.png

    however is there a way of not showing the list, which is visbale when the screen loads, just the searchbox, and they type name, then it shows the result?

     

    Thanks

  • victorcp Profile Picture
    2,350 Moderator on at

    yes, you can add another condition to check if the searchbox is empty like this:

    Filter(Visitorentrylist,StartsWith('Name (FirstName)',TextInput1.Text) && !IsBlank(TextInput1.Text))

    Or set the gallery visible to:

    !IsBlank(TextInput1.Text)

     

    Both works, but I prefer the first solution because there are some frames that will display some unexpected items and then they will disapear (in this context visible property is faster than items)

  • AndyPowerAppNew Profile Picture
    519 on at

    Hi @victorcp ,

    That is perfect - Thank you, also is there something where i can put records in alphabetical order automatically in the gallery?

    Thanks

  • victorcp Profile Picture
    2,350 Moderator on at

    and yes, you can sort it by any column that you want, like this:

    Sort(Filter(Visitorentrylist,StartsWith('Name (FirstName)',TextInput1.Text) && !IsBlank(TextInput1.Text)), 'Name (FirstName)')

      

  • AndyPowerAppNew Profile Picture
    519 on at

    Hi @victorcp , Thank you, how can i add sort  alphabetical order automatically to this string?

    Filter(VisitorEntryList,StartsWith('Name (FirstName)',TextInput1.Text) && !IsBlank(TextInput1.Text),IsBlank(Status.Value))

    Kind Regards

  • victorcp Profile Picture
    2,350 Moderator on at

    try this:

    Sort(
     Filter(VisitorEntryList,StartsWith('Name (FirstName)',TextInput1.Text) && !IsBlank(TextInput1.Text),IsBlank(Status.Value))
    , 'Name (FirstName)', Ascending)
  • AndyPowerAppNew Profile Picture
    519 on at

    Hi @victorcp,

    Thats great, Thank you - what would i need to apply alphabetical sort to this:

    Filter(
    StaffWhosIn,
    IsBlank(TextInputStaff.Text) ||
    StartsWith(
    Name.Value,
    TextInputStaff.Text
    ),
    IsBlank(Status.Value)
    )

     

    Thanks

     

  • Verified answer
    victorcp Profile Picture
    2,350 Moderator on at

    Sort function works like this:
    Sort( YourCollection/List/Table , Column to be sorted, Ascending/Descending)

     

    Sort(
    Filter(
    StaffWhosIn,
    IsBlank(TextInputStaff.Text) ||
    StartsWith(
    Name.Value,
    TextInputStaff.Text
    ),
    IsBlank(Status.Value)
    ),
    YourColumn, // Replace with the name of your column
    Ascending
    )

     

    If it resolve your problem please accept it as solution

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard