Filtering large list by lookup column

It happened to me to filter a list by a lookup column, but only recently I applied a filter on a large list, with over 60,000 items, which of course exceeded the limit set by the administrator. I was confused. My filter did not return more that 200 items and I received the following error: “The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator.“.

This is kind of moment you do not want to see. Column is indexed, but still this error. The issue actually was caused by the fact I didn’t filter the list by lookup id. Filtering large list by lookup is not a workaround and adding LooupId=’TRUE” in CAML query is solving your issue.

<View><Query><Where><Eq><FieldRef Name="InternalName" LookupId="TRUE" /><Value Type="Integer">100</Value></Eq></Where></Query></View>

Leave a Reply

Your email address will not be published. Required fields are marked *