web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Need help for delegati...
Power Apps
Answered

Need help for delegation warning fault

(0) ShareShare
ReportReport
Posted on by 8
Hi everyone, 
 
Hope you are doing well. 
 
I made a simple app that query the data from excel file on SharePoint. I have the textbox to input the serial number and will display the content on the FormViewer. So, I use the simple code as below on the formviewer Item:
LookUp(Records,Trim(Serial)= TextInput4.Text)
 
However, I got the Delegation warning as the "Trim" part of this formula might not work correctly on large data sets. My Serial column in my dataset is only the number. I have to use Trim to cut off the space at the front of the number (I think) and the code work but it gives the delegation warning fault. 
 
If I remove Trim function, I will have the fault: 
 
 
Could anyone help me to resolve this problem please? thank you very much for all your helps. 
Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    You are correct in the Trim() is not supported by Delegation. If it is always a single space, then this is Delegable
    LookUp(
       Records,
       Serial = " " & TextInput4.Text
    )
     
    Please Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like
    Visit my blog
    Practical Power Apps    LinkedIn  
  • Verified answer
    RaghavMishra Profile Picture
    261 on at

    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

  • Verified answer
    11manish Profile Picture
    3,333 on at
    The delegation warning isn't caused by the LookUp() itself—it's caused by using Trim() on the Serial column. The best solution is to clean the source data and trim only the user's input:
     
    LookUp(
        Records,
        Serial = Trim(TextInput4.Text)
    )
     
  • CU25062156-1 Profile Picture
    8 on at
    Thank you very much everyone, your suggestions are greatly appreciated and helped me solve the problem. 
    Sorry just another small problem that hope you guys can help me as well. I applied your suggestions to another table with the Filter and Startwith function to list all the data associated with the serial number as below: 
     
    If(!IsBlank(txtSearch.Text),Filter(Records,StartsWith(Serial ,Trim(txtSearch.Text))),Records)
     
    There is no delegation error now, but it could not list all the record that I have. For example, I have the record with serial number 44411776. 
     
    However, if I input 4, it could not find that record. I happen to some other records that I have in the list as well. 
    Do you know what the reason is? and how could I make it work correctly? Thank you so much everyone, much appreciated !
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard