Friday, April 08, 2011

List View Lookup Threshold

In my workflow I have multiple 'Collect Data from Users' actions configured. It tested with no problems in my dev environment running with an admin account. However, in a separate test environment running the workflow as a normal user the workflow failed with the following error:

SP Workflow Error: An error has occurred in YourWorkflow

I searched the SP logs and found the following ULS error:

Some lookup fields were omitted from the query results because the list exceeds the lookup column threshold. 

The problem occurred because SP has a threshold on list lookup columns set to a default value of 8.

There are two possible solutions:
  1. Increase the threshold in Central Administration

    NOTE: It is recommended NOT to increase the threshold since it will affect performance across your web application.

    However, if you do want to increase the threshold you can do so in the Resource Throttling settings in Central Administration. Here you can "specify the maximum number of Lookup, Person/Group, or workflow status fields that a database query can involve at one time":

    1. Click Manage web applications.
    2. Select the web application you want to update.
    3. Click General Settings | Resource Throttling.


    4. Update the List View Lookup Threshold to at least 12.
    5. Click OK.

  2. Reduce the number of lookup columns in your workflow.

    NOTE - lists / libraries already have two lookup columns by default: 'Created by' and 'Modified by' so while the threshold is set to 8 you need to keep your additional columns to a maximum of 6.

7 comments:

  1. I found your blog after 3 days of struggling with the issue. It was the exact issue we were having in the our workflows when we migrated it to our UAT.

    Thanks for documenting this.

    ReplyDelete
  2. In my case, I get the issue even when I have only one column Title in my custom view on the list. However, the list does have 12 managed metadata fields, 5 person/groups but no lookups. Any idea what could be the issue?

    ReplyDelete
    Replies
    1. Manage metadata and person/group fields are also lookup fields.

      Delete
    2. Managed metadata are lookups to the hiddenTaxonomy list.

      Delete
  3. http://sourcecodeprogrammer.blogspot.com/

    ReplyDelete
  4. @Anonymous
    As was noted in the OP, User and group columns are also lookups. Internally, SPFieldUser is derived from SPFieldLookup and is a lookup into the user info list (that's where the user ID comes from). You've probably either got a lower threshold than 8, or there are more user/lookup fields in your view that you don't know about.

    ReplyDelete
  5. Had the same issue with a Silverlight app using the client object model. I did need that many lookups - saw the same message in the ULS and after a quick Google search found this solution. Works now!

    ReplyDelete