Hi everyone! I am new, learning PowerApps and would like to ask if somebody could help me with the following problem:
I have a gallery connected to a SP list containing various products, here is an example of the list:
Product |
Dogfood |
Parrotfood |
Collardog |
Toysparrot |
I built a searchbox with Filter(in) which works well if you would like to search for every product that contains "dog" it will give you Dogfood and Collardog in the gallery. But I would like to separate those searches so that when I type in "*dog" it will give me only Collardog or if I type "dog*" it will only return Dogfood (or any wildcard character, doesn't have to be *) .
I tried to play with Startswith and Endswith but I am too inexperienced to set it up if it's even possible to do it with those functions.
I would appreciate any help! Thank you!
Thank you @rubin_boer so much! This is perfect!
I will do the rest myself 🙂
Just a question, would the same formula be used for entries that are number based? Since you used Lower() here? Let's say if instead a name of the product we have an ID containing 10 characters?
Thanks!
@bladerunner this was fun
No Filter
No wildcard
Wildcard (xyz*)
Wildcard (*xyz)
Hr is the function for items
this only check for start and end , im sure you can add a sequenbce to its as well.
Switch(true,
And(IsBlank(Find("*",txtInput2.Text)),!IsBlank(txtInput2.Text)), Filter(aList,txtInput2.Text in Value),
IsBlank(txtInput2.Text),aList,
(Find("*",txtInput2.Text) = 1),Filter(aList, Lower(Mid(txtInput2.Text,2, Len(txtInput2.Text)-1)) in Mid(Value,1,Len(txtInput2.Text)-1)),
(Find("*",txtInput2.Text) > 1),
Filter(aList,
Lower(Mid(txtInput2.Text, 1,Len(txtInput2.Text)-1)) in Lower(Mid(Value,Len(Value) - Find("*", txtInput2.Text,1)+2,Len(txtInput2.Text)-1))))
hi @rubin_boer thanks for the link but unfortunately this is what I already have.
On your example for jack - I set it up so I get if the entry contains jack but I want to add a wildcard character so I can specify if i want an entry that ends with jack (*jack) or that starts with jack (jack*). Is that possible?
Thanks!
hi @bladerunner havea look at this https://powerusers.microsoft.com/t5/Building-Power-Apps/Combo-Box-wildcard-search/td-p/672356
hope it helps you
WarrenBelz
146,645
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional