Hi All,
Currently I am using the following to filter a Datatable, Filter('Tbl',DESCRIPTION=Combo_1.Selected.Value).
This works ok, but is there a way that I can use the functionality of Search, i.e. filtering the table as you type, but with no delegation issues? Would I need to use a collection?
Thanks in Advance
Hi @cdwhite
Not quite what I was after.
I have Datatable, not Gallery, which has PO Number, Date, Description and supplier. Currently, I am using a collection in my combo box to search for the Description of a PO. What I would like is to have the functionality of search, to search the description directly on the table. But it would need to be delegable as my data source is over 2k lines.
Regarding delegation, the answer depends on your data source. For SharePoint:
StartsWith:
The Search function is not a delegable function in SharePoint, but you could use the StartsWith function, which is delegable. The obvious drawback is that this function only returns matching values based off the start of the search text.
Filter(
'Your Data',
Len(Your Dropdown.Selected.Value) = 0 || 'Field 1' = Your Dropdown.Selected.Value,
StartsWith(
'Field 2',
TextInput1.Text
) Or StartsWith(
'Field 3',
TextInput1.Text
)
)
Filter
The Filter function is delegable with SharePoint. If you can pre-filter your lists on a specific criteria that will return less than 2,000 rows, you can then perform a Search function on that smaller subset of data. For example we could have population data that has 5,000 rows of people per district, but if we know that each neighbourhood within those districts will return less than 2,000 rows, it is ok to use a non-delegable function within that smaller subset using delegable Filters.
Dataverse
Dataverse includes enhanced delegation for the IN operator.
Filter(
'Your Data',
Len(Your Dropdown.Selected.Value) = 0 || 'Field 1' = Your Dropdown.Selected.Value,
TextInput1.Text in 'Field 2' Or TextInput1.Text in 'Field 3'
)
------------------------------------------------------------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved. Remember, you can accept more than one post as a solution.
If you like my response, please give it a Thumbs Up.
You should be able to do this. How are the current results being shown, in a gallery?
If so, firstly, add a Text Input control to your app, this will act as your search box.
You can then extend your existing Power Fx to include the Search function:
Search(
Filter('Tbl',DESCRIPTION=Combo_1.Selected.Value),
TextInput.Text,
"column1", "column2"...
)