I am able to query and get an array of all my term names and guids within a Term Set, but now I want to be able to set these via REST. When I look at the structure in JSON the section with my Managed Metadata appears as follows. It seems like a sub-array
"TextField": "My Text",
"MMField": {
"Label": "7",
"TermGuid": "7d5e44d8-e5a7-4eb7-9735-7b51cea64aa8",
"WssId": 7
},
Using AngularJS I have tried posting to it via the following:
var itemEntry = new appItems;
$scope.createEvent = function () {
// Taxonomy Value Posting
itemEntry.TextField = 'Hooray Text';
itemEntry.MMField.Label = '7';
itemEntry.MMField.TermGuid = '7d5e44d8-e5a7-4eb7-9735-7b51cea64aa8';
itemEntry.MMField.WssId = '7';
itemEntry.$save(function () {
$location.path('/');
});
}
However, it is failing on the first option of MMField.Label as follows:
Unable to set property 'Label' of undefined or null reference
Using REST I should be able to hit the straight values and set this, but I must be missing something obvious. Any clues/what am I missing to hit the sub values within MMField?