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 creating a list instance in an XML file and I have some fields which are of type "Person or group". In the XML I can specify it like this:

     <Field Name='ID'>100</Field>
     <Field Name='Title'>Foo Bar</Field>
     <Field Name='MyGroup'>66;#SomeOfMyGroups</Field>

Notice the declaration of the group: 66;#SomeOfMyGroups.

When I do this it works, but I don't know what the ID of the group will be at some point.

If I specify it like this <Field Name='MyGroup'>SomeOfMyGroups</Field> it no longer works, the row is excluded when the list instance is created.

How can I set the value for the row without relying on the ID and just use the name (the name never changes, the ID might)?

share|improve this question
The ID never changes. The name could be changed, it might not in your project, but it is capable of being changed by someone with the right permissions. – Eric Alexander Dec 13 '11 at 13:31
up vote 1 down vote accepted

You can use a feature receiver for this, as described in the answer at:

This way you can generate valid ID+Name sets for your rows.

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.