Trying to get the selected value from a taxonomy field in sharepoint online using CSOM. But when getting the taxonomyfieldvalue it is null, why?
if (listitem.FieldValues.ContainsKey("Division")) // Returns true
{
TaxonomyFieldValue taxField = listitem["Division"] as TaxonomyFieldValue; // returns null !!
pi.Division = taxField.Label;
}
you need to get values as below:
TaxonomyFieldValueCollection Test = (list.Items[0]["Field Name"] as TaxonomyFieldValueCollection); var valuesList = (from v in Test select v.Label).ToList();