Summary
A gallery in Power Apps failed to filter correctly when combining Text Input and Combo Box criteria. The engineer attempted to use the Search() function, which only supports a single text column, causing the multi‑filter logic to break. The issue stemmed from misunderstanding how delegation, Search(), and Filter() interact in real systems.
Root Cause
The failure occurred because:
Search()only works on one column at a time, so combining multiple fields inside it is invalid.Or()insideSearch()is not supported, leading to non-executable expressions.- ComboBox selections return records, not plain text, requiring explicit field references.
- Filter logic must be composed manually when multiple independent filters are applied.
Why This Happens in Real Systems
Real Power Apps systems often hit this problem because:
- Developers assume
Search()behaves like SQL full‑text search. - Power Apps has strict delegation rules, and
Search()is only partially delegable. - UI controls (ComboBox, TextInput) return different data types, making direct comparison tricky.
- Multi-filter scenarios require explicit boolean logic, not implicit search behavior.
Real-World Impact
When implemented incorrectly, this leads to:
- Empty galleries even when matching data exists.
- Slow performance due to non-delegable queries.
- Inconsistent filtering when one control overrides the other.
- User confusion because filters appear to “not work.”
Example or Code (if necessary and relevant)
Below is the correct pattern using Filter() with combined conditions:
Filter(
Table1,
(IsBlank(TextInput1.Text) || StartsWith(ColumnB, TextInput1.Text)) &&
(IsBlank(ComboBox1.Selected.Title) || StartsWith(ColumnA, ComboBox1.Selected.Title))
)
How Senior Engineers Fix It
Experienced engineers resolve this by:
- Replacing
Search()with explicitFilter()logic. - Using StartsWith() for delegable text filtering.
- Adding IsBlank() guards so empty filters don’t block results.
- Ensuring ComboBox references use
.Selected.<Field>. - Validating delegation warnings early in development.
Why Juniors Miss It
Less experienced developers often overlook:
- Delegation limitations and how they affect filtering.
- The fact that Search() cannot combine multiple fields.
- Differences between record values (ComboBox) and text values (TextInput).
- The need for explicit boolean expressions instead of relying on Search’s implicit behavior.