Hi CU25062156-1,
Good news - this is a classic delegation issue and it's well documented, so it's fixable. Let me explain what's happening and how to clear the warning.
Why Trim() triggers the warning
The delegation warning appears because Trim is not a delegable function for the SharePoint/Excel data source. When a function can't be delegated, Power Apps processes it locally, which means it only pulls down the first 500 records by default - so on large data sets your LookUp can silently miss matches beyond that limit. That's exactly the risk the warning is alerting you to.
Note that TrimEnds IS delegable, while Trim is not - that difference is the heart of your problem.
The cleanest fix: don't trim in the query at all
Rather than trimming inside the LookUp, handle the leading space on the input side so the comparison stays delegable:
- Trim the text input value first, then compare against the raw column:
LookUp(Records, Serial = Trim(TextInput4.Text))
Here Trim runs on a single control value (a constant for the query), not on every row, so it stays delegable and the warning goes away.
- Even better, if your Serial column never actually contains leading/trailing spaces, you can drop trimming on the column entirely and just clean the input.
About the second error (when you remove Trim)
The "Unable to match columns in the filtered view. Filtered columns count: 17, actual columns count: 18" message is a separate column-mismatch/indexing issue on the SharePoint side, not the delegation warning itself - it usually means the view's columns and the actual list columns are out of sync. Refreshing/re-adding the data source connection in the app so it re-reads the current schema typically resolves it.
If you genuinely need to scan more rows locally
You can raise the non-delegable record limit in Settings > General > Data row limit (default 500, max 2,000). This is a workaround, not a true fix - delegating the query is always preferable for performance and accuracy. A handy testing tip from the docs: set the Data row limit to 1 temporarily so any non-delegable formula returns just one record, making it easy to spot what isn't delegating.
One honest caveat
Microsoft Learn clearly documents the delegation behavior, the delegable/non-delegable function lists, and the row-limit settings above. The specific SharePoint "column count mismatch" network error isn't described as a fixed, named limitation on a single Learn page, so that part is general troubleshooting guidance rather than a quote from the docs.
Reference
Found this helpful? Please mark ✅ "Does this answer your question?" so others searching for the same issue can find it quickly. A 👍 on "Was this reply helpful?" or a ♥ Like is also much appreciated!
Raghav Mishra - LinkedIn | PowerAI Labs