cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
SumanKoduri
Level: Powered On

How to use like operator filter record based on text input

Hi,

I have one text input field and gallery, my gallery needs to filter based on text pattern entered in text box

For ex: If I enter 101, 102 in text box , if my gallery contains Item number all the items starting with 101 and 102 needs to be displayed

Gallery needs to be filtered based on the pattern we entered

4 REPLIES 4
Super User
Super User

Re: How to use like operator filter record based on text input

You can use something like this:

Filter(DataSource, StartsWith(ItemNo, TextInput.Text))

Where ItemNo is the column that has the item number and DataSource is the Items property of the gallery.

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com
SumanKoduri
Level: Powered On

Re: How to use like operator filter record based on text input

Thanks for your reply.

 

But if I have 2 numbers like I need to fetch items starting with 101 and 102 at that time how to use filter query, In text box i will give as 101, 102 in gallery it needs to fetch all the items starts with the items entered in text box

Super User
Super User

Re: How to use like operator filter record based on text input

You will first have to split your text into 2. So if a user types 101 102 in tour text input control, you will need to split it and search using something like this:

Filter(DataSource, StartsWith(ItemNo, First(Split(TextInput.Text, " "))) || StartsWith(ItemNo, Last(Split(TextInput.Text, " "))))

Let me know if this helps. It assumes user will enter only two sets of numbers in the text box. If it's more, this formula can be adapted accordingly.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com
SumanKoduri
Level: Powered On

Re: How to use like operator filter record based on text input

I'm getting error as Invalid argument type(Record).expecting text value instead when I try this filter part

Filter(ds,StartsWith(Fieldname, First(Split(TextInput3.Text, "."))) || StartsWith(Fieldname, Last(Split(TextInput3.Text, "."))))

 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,006)