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

I have the following default sample data in my list which deploay just fine.

<Row>

        <Field Name="Holiday Balance (Days)">10</Field>
        <Field Name="Holiday Balance (Hours)">700</Field>
    </Row>

However when I try to include the Collumn which contains a people picker

<Row>
        <Field Name="Team 1">My User Name</Field>
        <Field Name="Holiday Balance (Days)">10</Field>
        <Field Name="Holiday Balance (Hours)">700</Field>
    </Row>

It deploys fine but NO content...is this a limitation of VS deployed lists? For username I have tried my name, my email and my "key" to no avail.

TIA

S

share|improve this question
add comment

1 Answer

Prepopulating lists with users is tricky because a User field is a special type of Lookup field. This means that you need to know the value of the ID of the user more than the name of the User.

This is possible if are deploying your feature to a single known site. But the same user can have different ID values on different site collections. So if this feature will be targeted to multiple site collections, then you will need to use a feature receiver to prepopulate the list.

For more information, see Adding Sample data to User Field type.

share|improve this answer
    
Thanks Rich your on a roll! I just need the data for development purpose's when the app goes live it will go live with no data and its up to the user to fill this list in. Been trying to find out the user ID's to no avail within my SharePoint 2013 dev environment. –  Stephen Feb 15 '13 at 15:52
    
I haven't played with SP 2013 yet, but if it's anything like 2007 or 2010, if you click on the hyperlink of any user on the site, you are taken to the User Information page for that user. The value of ID query string parameter in the URL of the User Information page will be the user's ID. –  Rich Bennema Feb 15 '13 at 19:02
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.