I'm trying to use the Client Side Object Model of SharePoint 2013 to read a managed meta data field but I get null results
When I look in the Site Columns, there are 5 fields in the "GroupName" column group that should be returned:
- 1 single line of text field
- 4 managed metadata fields
I'm using this C# to get the columns in the group:
private void StackDemo(){
string contextUrl = "http://mysitecollection/sites/mysite";
string columnGroup = "GroupName";
var ctx = new ClientContext(contextUrl)
{
Credentials = CredentialCache.DefaultCredentials
};
var query = ctx.LoadQuery(from x in ctx.Web.Fields where x.Group== columnGroup select x);
ctx.ExecuteQuery();
return query.FirstOrDefault();
}
When I view the query results I can view the plain text field, but all the other fields are null (see screenshot)
The weird thing is there is a result for each metadata field, but the value is null
.
I want to
Know why I'm getting nulls, even though the query is returning 5 items as expected
Get the field's internal names of the managed metadata columns