Hi
I have a Gallery "Gallery1" and I have a connection to a SharePoint List "ProjectVertigo"
I put a textbox and a button on my page.
I would like the gallery to filter by the items that match my textbox.
I try to do this in the OnSelect of the Button
Filter(ProjectVertigo, TextInput1.Text in ProjectVertigo.Title)
But nothing happens?
Thanks
P
Solved! Go to Solution.
Hey @pmwhelan
Do this:
On the button's on select:
UpdateContext({gFilter:TextInput1.Text})
Gallery Items property:
If(
IsBlank(gFilter),
ProjectVertigo,
Filter(
ProjectVertigo,
Title=gFilter
)
)
Take another button, name it as unfilter:
Set its on select property:
UpdateContext({gFilter:Blank()})
Hey @pmwhelan
I did a similar scenario in my gallery, and I wrote
Filter(ProjectVertigo, TextInput1.Text = Title)
or
Filter(ProjectVertigo, TextInput1.Text in Title)
No need to write
ProjectVertigo.Title
Just Title would do, as you have already written the data source outside.
Thanks for the help.
I tried
Set(vSearch, "Ready");
Filter(ProjectVertigo, tbSearch.Text = Title);
Set(vSearch, "Done");
I have vSearch as the Text of a Label (just to make sure it runs)
Still the gallery doesn't change at all.
Thanks
You can do Something like this.
Filter(
ProjectVertigo,
StartsWith(
Title,
TextInput1.Text
)
)
Use Startwith function to search in powerapps. If this code solves the problem mark as solved.
Tried that but it's not filtering the Gallery.
Do I need to refresh the Gallery after Filtering on the SharePoint List "ProjectVertigo"
no, you don't need to refresh to filter Gallery. It'll filter automatically. Just write that code on Gallery's Item property.
Hi @pmwhelan ,
Apply code on gallery item-
Sortbycolumn(Filter(ProjectVertigo,Startwith(Title,Textinput1.text)),"ID",Descending )
or
Filter(ProjectVertigo,Startwith(Title,Textinput1.text)
Thanks,
Chitrakant27
Hey @pmwhelan
Do this:
On the button's on select:
UpdateContext({gFilter:TextInput1.Text})
Gallery Items property:
If(
IsBlank(gFilter),
ProjectVertigo,
Filter(
ProjectVertigo,
Title=gFilter
)
)
Take another button, name it as unfilter:
Set its on select property:
UpdateContext({gFilter:Blank()})
User | Count |
---|---|
258 | |
110 | |
97 | |
57 | |
40 |