Showing posts with label set empty choice field. Show all posts
Showing posts with label set empty choice field. Show all posts

Friday, July 19, 2013

How to set the SharePoint choice field default value to null Using powershell

Lets assume we have a custom list "test1" which has a choice field "Choice". The values for the choice field are "A", "B","C" & "D".

If you create a Choice column through UI the default value will be selected as "A".

In this we will be seeing how to change the choice field default value to null using powershell

$site = Get-SPSite "http://serverName:1111/sites/sample "$web=$site.Rootweb$list = $web.Lists.TryGetList("test1")$field = $list.Fields["Choice"] $field.DefaultValue = $null
$field.Update()
$list.Update()