evoke it logo white with clear backQuick Contact

Add Default Data to Microsoft SharePoint List Declaratively

Add Default Data to Microsoft SharePoint List Declaratively

When creating Microsoft SharePoint lists through Visual Studio sometimes you want to have default data added to the list. In the case where you are using the Visual Studio List Designer you need to add this data into the Elements.xml file of your list instance. Inside the List Instance tag in your file you will need to add a Data tag and inside that a Rows and Row tag, each Row is an item in the SharePoint list. Inside your Row tag you can add in the fields of the list with their values like below:

When adding items this way SharePoint will create duplicates of the items each time the list is deployed to the site. To prevent this from happening you can specify the Id of the item.

You should now have your items in your list without any duplicates!

Be the First to Get Our Ebook
Microsoft SharePoint 2019

What you need to know!

Back To The BlogContact Support

View Post's Via Catagory

IT support laptop image
Software Development cloud image
Terms & ConditionsPrivacy PolicyDeveloped by Evoke IT