LookupColumn Element (View)

Applies to: SharePoint Foundation 2010

Functions similarly to the Column element but only valid when referring to a Lookup field. The only distinction between the Column and LookupColumn elements for Lookup fields is that LookupColumn retrieves the raw value of the column from the foreign list, while Column retrieves the raw value of the column in the local list.

    HTMLEncode = "TRUE" | "FALSE"    IncludeVersions = "TRUE" | "FALSE" 
    Name = "Text"
    ShowField = "Text"
    StripWS = "TRUE" | "FALSE"
    URLEncode = "TRUE" | "FALSE"
    URLEncodeAsURL = "TRUE" | "FALSE">





Optional Boolean. TRUE to convert embedded characters so that they are displayed as text in the browser. In other words, characters that could be confused with HTML tags are converted to entities.


Optional Boolean.


Required Text. Specifies the name of the lookup column. Allows the LookupColumn element to be used outside the field rendering context by supplying an ID.


Optional Text. Specifies the field to be displayed in the list that is referenced through the Lookup field. If this attribute is not specified, the default is to display the value contained in the Title field.


Optional Boolean. TRUE to remove white space from the beginning and end of the value returned by the element.


Optional Boolean. TRUE to convert special characters, such as spaces, to quoted UTF-8 format, for example, %c3%ab for character ë.


Optional Boolean. Like URLEncode, but TRUE to specify that the string to encode is a path component of a URL and not to encode the forward slash ("/").

Child Elements


Parent Elements



Minimum: 0

Maximum: Unbounded (1 within Expr1, Expr2, and UrlBaseName)


In the case of a Lookup field called LookupTitle that points to the title of item 1 in an announcements list, <LookupColumn Name="LookupTitle"/> would render "Get Started with SharePoint Foundation!" while <Column Name="LookupTitle"/> would render "1". Consequently, in most situations involving Lookup fields, use the LookupColumn element instead of the Column element. The only time to use the Column element is when you need a raw reference to the ID of the item in the target list, perhaps for constructing your own link to the target item.


The following example uses the LookupColumn element to return a value that is used in creating a complete URL for a page on the server.

<HTML><![CDATA[ <a href="  ]]></HTML>
<HttpHost URLEncodeAsURL="TRUE" />
<LookupColumn URLEncodeAsURL="TRUE" />
<HTML><![CDATA[ ">  ]]></HTML>

See Also


Column Element (View)