I have been trying to get a search to work from a text box without forcing a user to press the icon to dynamically update a data grid. My attempts were using the OnChange property on the text box but that wasn't successful.
Any suggestions or isn't this possible?
Ideally, when a user enters a "B" the grid will filter to names containing a "B". Once they enter "Bo" they will see names that contain "Bo". This would allow them to enter the fewest characters possible to filter the records.
Solved! Go to Solution.
Hi @MarcRohde ,
Do you want to filter your data table records based on a TextSearchBox?
Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:
Set the Items property of the Data Table to following formula:
Search('20190325_case13', TextSearchBox1.Text, "ProjectName")
On your side, you should type:
Search('YourDataSource', TextSearchBox1.Text, "FilteredColumn")
Or
Filter('YourDataSource', TextSearchBox1.Text in FilteredColumn)
Note: If you type above formula within your Data Table's Items property, but there is no data displayed, please consider type a text within the TextSearchbox, then remove it, after that, the issue would be fixed.
Please check the following GIF screenshot for more details:
In addition, I also think the Timer control could also achieve your needs. You could consider add a Timer control within your app, set the Duration property to following:
1000
set the AutoStart property and Repeat property to following:
true
set the OnTimerEnd property to following:
ClearCollect(RecordsCollection, Filter('YourDataSource', TextSearchBox1.Text in FilteredColumn))
set the Visible proeprty of the Timer control to following:
false
Set the OnStart property of the App control to following:
ClearCollect(RecordsCollection, 'YourDataSource')
Set the Items property of your Data Table to following:
RecordsCollection
then run your app, check if the issue is solved.
Above formulas may cause a Delegation warning issue, if the amount of your data source records is not more than 2000, you could ignore this issue. You could set the "Data row limit for Non-delegable queries" option to maximum value -- 2000 within Advanced settings of App settings, so you could process 2000 records locally at most in your app.
If the amount of your data source records is more than 2000, please check and see if the alternative solution within the following thread would help in your scenario:
Best regards,
Hi @MarcRohde ,
Are you using an O365 Connector or just a SP list?
Just leave the OnSelect() and OnChange() of the Text Box to false.
If Yes, set the Item() Property of the Gallery to:
If(IsBlank(TextInput1.Text), Office365Users.SearchUser({searchTerm:""}),If(Not(IsBlank(Trim(TextInput1.Text))),Office365Users.SearchUser({searchTerm:Trim(TextInput1.Text)})))
If it's a raw List:
If(!IsBlank(TextInput1.Text),Search(DataSource, TextInput1.Text, "ColumnName1", "ColumnName2"))
This searches the data source for records in which either the ColumName1 or the ColumName2 contains the search string (TextInput1.Text) anywhere within it.
Both works in Gallery and Data Table.
Best of luck.
Thanks,
K-A-R-L
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If you thought this post was helpful, please give it a Thumbs Up.
Hi @MarcRohde ,
Do you want to filter your data table records based on a TextSearchBox?
Based on the needs that you mentioned, I have made a test on my side, please take a try with the following workaround:
Set the Items property of the Data Table to following formula:
Search('20190325_case13', TextSearchBox1.Text, "ProjectName")
On your side, you should type:
Search('YourDataSource', TextSearchBox1.Text, "FilteredColumn")
Or
Filter('YourDataSource', TextSearchBox1.Text in FilteredColumn)
Note: If you type above formula within your Data Table's Items property, but there is no data displayed, please consider type a text within the TextSearchbox, then remove it, after that, the issue would be fixed.
Please check the following GIF screenshot for more details:
In addition, I also think the Timer control could also achieve your needs. You could consider add a Timer control within your app, set the Duration property to following:
1000
set the AutoStart property and Repeat property to following:
true
set the OnTimerEnd property to following:
ClearCollect(RecordsCollection, Filter('YourDataSource', TextSearchBox1.Text in FilteredColumn))
set the Visible proeprty of the Timer control to following:
false
Set the OnStart property of the App control to following:
ClearCollect(RecordsCollection, 'YourDataSource')
Set the Items property of your Data Table to following:
RecordsCollection
then run your app, check if the issue is solved.
Above formulas may cause a Delegation warning issue, if the amount of your data source records is not more than 2000, you could ignore this issue. You could set the "Data row limit for Non-delegable queries" option to maximum value -- 2000 within Advanced settings of App settings, so you could process 2000 records locally at most in your app.
If the amount of your data source records is more than 2000, please check and see if the alternative solution within the following thread would help in your scenario:
Best regards,
These both gave great direction! I was able to get it to work exactly how I needed it. Thanks for the replies.
User | Count |
---|---|
156 | |
91 | |
67 | |
63 | |
62 |
User | Count |
---|---|
211 | |
157 | |
96 | |
86 | |
76 |