I have created a list using schema.xml and then i have created a list instance. later on i need to to add one column in the list schema which is not shown in the existing list instance. any idea how to resolve it?

1 Answer 1


The list schema is actually a template used at creation time.

If you want to update the schema of existing list, you will have to update the list itself (or the content type if the list is bound to a site content type).

There is no OOB way to do this, but here is a script I use in an upgrade process. My app use site content types, and list schema attached to this content type. The feature upgrade add the column in the xml declaration for new list, and the PS script add the column to existing list :

add-pssnapin Microsoft.SharePoint.PowerShell -EA 0

function AddFieldToContentType([Microsoft.SharePoint.SPWeb] $web, [string]$contentTypeName, [string]$xmlSchema)
    $xml = [xml]$xmlSchema
    $fieldName = $xml.Field.Name
    if ($web.Fields.ContainsField($fieldName) -Eq $false) {
        $fieldName = $web.Fields.AddFieldAsXml($xmlSchema)
    $field = $web.Fields.GetFieldByInternalName($fieldName)

    $ct = $web.ContentTypes[$contentTypeName]
    if($ct.FieldLinks[$fieldName] -Eq $null) {
        $link = new-object Microsoft.SharePoint.SPFieldLink $field


[Microsoft.SharePoint.SPWeb]$web = get-spweb -Identity $url
$xml = '
    DisplayName="New column"
    Group="Your group" 
    Name="NewColumn" />'

AddFieldToContentType $web "YourContentType" $xml

[Edit] You can reuse the same principle in a feature receiver which upgrades the lists...

  • I'd also like to add, that the xml declaration in the script should match exactly the xml declaration of the feature's xml. This is not technically required, but will prevent some headache when maintening the application.
    – Steve B
    Jul 19, 2011 at 8:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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