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