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

Is it possible to add a new column to all existing views of a list or I have to do manually for each view?

share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

There is no way OOTB using the UI.

So you have to do it manually in the UI or through code (could be PowerShell).

If you create the column in the UI and deselect 'Add to Default View' and then run the following in 'SharePoint 2010 Management Shell':

$web = Get-SPWeb "http://sharepoint"
$list = $web.GetList("http://sharepoint/Lists/MyList")
$field = $list.Fields["NewColumn"]
0..($list.Views.Count-1) | foreach-object {
  $view = $list.Views[$_];$view.ViewFields.Add($field);$view.Update()
  }
share|improve this answer
    
Can please provide a link which explains it? –  saumilm May 14 '12 at 4:55
1  
Example added. Urls and names should be replaced –  Per Jakobsen May 14 '12 at 5:24
add comment

You can see the link below, that has a PowerShell 1.0 code to use in SharePoint 2007 environment (that of course can be adjusted to use in SharePoint 2010 environment too)

http://antonioaugusto.com.br/blog/2013/03/19/como-adicionar-uma-nova-coluna-a-todas-as-visualizacoes-de-uma-lista-usando-powershell/

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.