cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
2132143
Advocate I
Advocate I

Creating a search filter in PowerApps

So I was following this video Applying filter in PowerApps DataTable - YouTube and used the same formula as mentioned.

However, I'm still getting errors and not sure why.

 

DataTable1 is my data table that I'm working with

Title_Column1 is the column I'm trying to search in

TextInput1 is my textinput box I'm using to search

 

Somehow though, this isn't working. The errors are very vague as well, just says invalid argument types and invalid argument.

1 ACCEPTED SOLUTION

Accepted Solutions

@2132143 

 

Recommend keep SharePoint and not use Excel if possible.

 

Temporarily to test, use this - no variables

 

Items of Data Table:

 

If(!IsBlank(TextInput1.Text),Filter('30M Report', Title=TextInput1.Text),'30M Report')

 

And to temporarily test it, just use the above. Remove the Set from OnVisible, and remove the Set from elsewhere.  Even for the OnChange on the Text Input, change it to have nothing in it (or just false) and the OnSelect of the Search button, do the same

 

If the above works, you can keep the temporary as the permanent solution.

If you need the non-exact match, try to change it to the below, see if it works

 

Items of Data Table:

 

If(!IsBlank(TextInput1.Text),Filter('30M Report', TextInput1.Text in Title),'30M Report')

 

If the above works, keep the solution like that, but if you have more records later than 500, you may need to use the ForAll. You can then try the below in case too:

 

 Items of Data Table:

 

If(!IsBlank(TextInput1.Text),ForAll('30M Report', TextInput1.Text in ThisRecord.Title),'30M Report')

 

See if this works better @2132143 

 

 

 

View solution in original post

30 REPLIES 30

@2132143 

 

You should Filter on a Data Source, not a Column

Filter(DataTable1 ...

Drrickryp
Super User
Super User

@2132143

Items property of the datatable:

Filter(yoursharepointlist, StartsWith(Title,TextInput1.Text))

getting errors with 

 

Filter(DataTable1, StartsWith(Title, TextInput1.Text));

 

and with

 

Filter(DataTable1, StartsWith(Title_Column1, TextInput1.Text));

Drrickryp
Super User
Super User

@2132143 

Is Datatable1 really the name of your SharePoint list?

Oops, updated to: 

 

Filter('30M Report', Title=TextInput1.Text);

 

no errors now but how can I get this to only show me the title that I type? right now nothing happens when clicking search.

Filter('30M Report', StartsWith(Title, TextInput1.Text));

 

sent the wrong formula, both don't work though

To see if it is contained and not just starting with, try this:

 

Filter('30M Report', TextInput1.Text in Title);

 

The above is recommended, but if you don't want delegation warning and you have a lot of Records (like more than 500), maybe the below version works more properly for you:

 

ForAll('30M Report' As myRecord, TextInput1.Text in myRecord.Title);

 

 

so I'm using Filter('30M Report', TextInput1.Text in Title); now but for some reason nothing is filtering out. 

2132143
Advocate I
Advocate I

2132143_0-1665149785580.png

 

 

Here is an example

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,474)