Hi,
I have this -
StartsWith(Control_two.Value, 'search box'.Text) || StartsWith(ID_three, 'search box'.Text)
but this only searches for the first part of the string. How can I do a full Contains here?
Thanks
Ok, so you are trying to do a search within a choice value. That's a little unusual, but we can get it to work:
Search(AddColumns(sharepointlist,"choicevalue",column_two.Value), TextSearchBox1.Text,"ID_three","choicevalue")
Search only works on text fields, not choice fields. So, the above adds a column to the list in powerapps. the column is named "choicevalue", though the column name doesn't really matter. What matters is that you reference that same column name in the later argument. So, after the column is added, the result of addcolumns is used by search. Search is looking for the contents of the textbox in any location of the following two fields: id_three and chocievalue.
Full code for browsegallery items property -
SortByColumns(
Filter(
Filter(
[@'Data Source'],
Lower(User().Email) = "email@gmail.com" //Requestor can only see their own requests
),
StartsWith(Control_two.Value, 'search box'.Text) || StartsWith(ID_three, 'search box'.Text)
),
"Title",
If(
SortDescending1,
SortOrder.Descending,
SortOrder.Ascending
)
)
both ID_three and Control_two.value both exist in my gallery/sp list.
How can I search for them using my "search box". I dont want to search for beggining, I want to find ANY letters in either of these two fields.
ID_three is a single line of text and control_two.value is a choice.
How can I alter my current code so I can search for any values with these two fields, could be beginning middle or end.
Does the filter not work for you? If not please provide specific examples of what you're trying to accomlish.
i need to be able to filter my browsegallery by control_two column values.
Search is used to find text within a large block of text. If it's a choice, do you really need to search within the choice value?
For example, if the choices are north, south, east, and west. Do you need to let the user find all choices with the letter "e"? Or are you looking for all list items that have west? I assume the latter? If so, use filter instead of search:
Filter(sharepointlist,control_two.Value="West")
@Mike2500 its a choice column. Is there another way to check?
What data type is control_two?
What are you finding text in? Your code looks like a boolean statement, are you using this on a control, or to search a data source?
What is control two? After "search box.text", the next item should be the name of the field, in quotes, that you want to search. Optionally, after that, you can put the name of a second field you want to search.
The delegation warning is expected. This will not work with larger datasets.
WarrenBelz
146,635
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional