SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm following the steps in this article to setup a joined data view webpart joined on a lookup field:

To summarize these steps, I need to expose the ID column as an additional field in the lookup:

enter image description here

(image copied from linked blog post above)

I'm creating my lists and lookup columns declaratively inside a Visual Studio solution, and I would like to add this additional field in the xml. How do I do this?

The xml definition for my lookup field is as follows:

<Field ID="{5D184D01-082C-4831-8757-CA2C98F05221}"  
       DisplayName="Event Inquiry"  
       Group="Ops Inquiry Tracking Columns"  
       List="Lists/Event Inquirys"></Field>
share|improve this question
up vote 8 down vote accepted

To setup the additional field from the lookup, you need to add a second lookup field pointing at the same list, but include the FieldRef attribute on the second lookup field. The value of this attribute should be the same as the ID attribute of the first lookup field.

<Field ID="{393F697A-7F99-488E-B67F-41DFD6D41857}" 
       DisplayName="Event Inquiry:ID"  
       List="Lists/Event Inquirys"></Field>
share|improve this answer

For me the example provided on worked to get the second field from the lookup.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.