Skip to main content

Notifications

Power Apps - Building Power Apps
Unanswered

Search Box

(0) ShareShare
ReportReport
Posted on by 28

Hi

I am very new to powerapps so this is probably a very basic question but I just can't get the search to work for me.

 

I am connecting to a sharepoint list called Store Locations and Location is the name of the column to search on.

 

In Gallery - items property - this works with just wanting to sort.

Sort('Store Locations', Location, If(SortDescending1, Descending, Ascending))

 

But now I want to add a search box - so users can enter a location in the search box that will then show only that location.

 

I have tried to change the items property for gallery to 

Sort(Search('Store Locations','TextInput1-Search' Location, Store),Location If(SortDescending1, Descending, Ascending))

but I keep getting an error message with that.  I'd appreciate any help that you can give.

 

And a follow-up question - do I need to add any properties to the search box field?

 

Thanks

Becky

 

 

 

Categories:
  • BeckyC Profile Picture
    BeckyC 28 on at
    Re: Search Box

    I tried the above and I still have something incorrect.  I am getting the error 

    Invalid argument type (record). Expecting a text value instead

     

    I think that the error is in my search function, but I don't know why. I got rid of the sort and only have

    Search('Store Locations',TextInput1-Search.Text,Location)

    and I get:

    The search has some invalid arguments.  I took out the search for Location & Store because store is a numeric field and I wondered if that was the issue - location is a text field.  My search box has the format of text.

     

    So can someone tell me what I am doing wrong with my search formula?

  • timl Profile Picture
    timl 34,222 on at
    Re: Search Box

    Hi Becky,

    Something like this should take you closer.

    Sort(Search('Store Locations',TextInput1-Search.Text, Location, Store),
     Location,
     If(SortDescending1, Descending, Ascending)
    )

    The main thing is the part where you reference your text input control. If the name of your text input control is TextInput1-Search, TextInput1-Search.Text returns the contents of the text input control. Also, your formula was missing a comma.

    In answer to your second question, there are no specific properties that you need to add to your search box.

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,508

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,839

Leaderboard