0

How can we retrieve all the choice values in the choice field using powershell CSOM

i hardly could not find any resources for this functionality

any help would be appreciated

1
  • 2
    you can check this link here Commented Jul 3, 2019 at 8:30

1 Answer 1

0

You can use the PowerShell command below:

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

$WebURL="http://intranet.crescent.com/"
$ListName ="Projects"
$MultiChoiceFieldName="Category"

$Web = Get-SPWeb $WebURL
$List = $Web.lists.TryGetList($ListName)
#Get the 1st item stored in the list
$Item = $List.items[0]

#Get the multiple choice field 
$MultiChoiceValues = New-Object Microsoft.SharePoint.SPFieldMultiChoiceValue($Item[$MultiChoiceFieldName])

#Print Each Value
For($I=0; $I -lt $MultiChoiceValues.count; $I++)
{            
 write-host $MultiChoiceValues[$I]
}

Reference: Get-Set Choice Field Value in SharePoint using PowerShell

1
  • we need powershell Csom script to run it on sharepoint online Commented Jul 4, 2019 at 10:37

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.