Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

So I have been able to populate rows with Lookup type fields as such:

<ListInstance ... >
  <Data>
    <Rows>
      <Row>
        <Field Name="LookupColumn">2;#LookupValue</Field>
      </Row>
    </Rows>
  </Data>
</ListInstance>

But how do I populate multiple values in the same manner for a LookupMulti typed field?

I can get one value, but have been unable to figure out how to populate more.

Relevant XML

Schema.xml

  <Field ID="{69FCEC38-3F15-48DB-891E-D76EF66A02A4}"
         Name="MultiLookupColumn"
         Type="LookupMulti"
         List="Lists/Target"
         ShowField="Title"
         Mult="true"
         DisplayName="MultiLookupColumn"
         Required="false"/>

Elements.xml

<ListInstance ... >
  <Data>
    <Rows>
      <Row>
        <Field Name="MultiLookupColumn">1;#Value1;#2;#Value2</Field>
      </Row>
    </Rows>
  </Data>
</ListInstance>

I know the schema is right because I can add multiple items via the AddItem.aspx form.

Edit

The schema may be wrong. The form allows me to add multiple but when I do still only the first value displays.

share|improve this question
    
add comment

3 Answers

up vote 7 down vote accepted

Try 1;#LV1;#2;#LV2;#3;#LV3. Each item seperated by ;#

share|improve this answer
    
useful answer! note: no need to specify title, just ID means and it gets correct titles! –  devi Nov 28 '12 at 12:54
add comment

My problem was resolved by changing Mult="true" to Mult="TRUE" but this was not what I asked.

share|improve this answer
    
Thank's a lot. But is really weird. What's the difference? –  fallout Jul 3 '13 at 10:46
    
I still have no idea why, but I'm assuming it just doesn't parse the lowercase "true" correctly... for whatever reason... since this incident I've always used all uppercase "TRUE"s everywhere and haven't had any problems like this again. Truly weird. –  RJ Cuthbertson Jul 3 '13 at 12:54
add comment

If you are only using id's, it worked for me only with:

1;#;#2;#;#3

share|improve this answer
add comment

Your Answer

 
discard

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.