0

We want to create a new column called "Year" (Tasks > Settings > Create Column) and set a default value to "2016". Default value is already displayed when we create new task, but we have a lot of tasks we created before. Is there any way we can add default value to existing tasks?

1

1 Answer 1

1

You have to code for the same, you cannot achieve using OOTB(Out Of the Box) functionality.

Options: Client Side(from Browser):

  1. Rest API
  2. JavaScript Object Model

C#:

  1. Server Object Model
  2. Client Object Model

Also if you have handy knowledge of power shell, you can write power shell script to achieve the same.

# Add SharePoint PowerShell Snapin  
if ( (Get-PSSnapin -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null ) {  
Add-PSSnapin Microsoft.SharePoint.Powershell  
}
$web = get-spweb http://site/web
$lists = $web.Lists["list name"]  
$items = $lists.items  
foreach($item in @($items))
{
$item["ColumnName"] = $NewValue
$item.update()
}        
$list.update()  

Your Answer

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