Quickly determine unique values in a SharePoint field Quickly determine unique values in a SharePoint field
Jaydeep Patel

Jaydeep Patel

January 28, 2013

All Post
Quickly-determine-unique-values-in-a-SharePoint-field
Share:

Report on unique values in a SharePoint field

Ever need to know which values are in use for a multi-select field? Here’s a quick and easy way to do it:

$web= Get-SPWeb "http ://SharePoint/SPWeb/"
$FieldName="Activity" # use your own field name
$list = $web.Lists["ListName"]
$activities = @()
foreach($doc in $list.Items) { $activities += $doc[$FieldName] }
$activities | Select-Object -Unique | Sort-Object

Leave a Reply

Your email address will not be published. Required fields are marked *

Want to talk?

Drop us a line. We are here to answer your questions 24*7.