List attribute of Lookup field schema – Using URL versus GUID

There has been a lot of research about the List attribute of the XML schema of Lookup fields. In this post I will summarise their findings and add my 2cents about the pros and cons of each approach.

Some recommended readings on the issue:

A summary of their findings:

  • The List attribute can be set to the web-relative URL of the source list, e.g. Lists/SourceList. This however only works when the Lookup field is being defined locally within the list schema like below.
<List xmlns:ows="Microsoft SharePoint" Title="SharePointProject7 - ChildList" ...>
 <Field ID="{2EE02D6F-DFF1-417D-AED7-D139B9653D1F}"
 Type="Lookup" Name="MyField" DisplayName="MyField To Display"
 List="Lists/SourceList" ShowField="Title"/>
  • Alternatively, the List attribute can be set to the GUID of the source list.


Pros and Cons

Pros of using the URL approach:

  • Simplicity: no additional coding is required

Cons of using the URL approach:

Pros of using the GUID approach:

  • Can create site columns
  • Can create cross-web Lookup fields

Cons of using the GUID approach:

  • Additional C# coding is required

My recommendation is to use the URL approach only for very simple scenarios where reusability is not a current or likely future requirement. Use the GUID approach for a more future-proof solution.


About Bernado

Based in Australia, I am a freelance SharePoint and Dynamics CRM developer. I love developing innovative solutions that address business and everyday problems. Feel free to contact me if you think I can help you with your SharePoint or CRM implementation.
This entry was posted in Lookup Columns, SharePoint, SharePoint 2010, Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s