I'm using below code to update multiple lookup fields of document library
Code:
var itemProperties = { '__metadata': { "type": "SP.Data.WP_x005f_DocumentsListItem" }, 'Technology_StackId': { "results": [1,2] }} // multi-valued field }
$.ajax({
url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('" + listName + "')/items(" + itemId + ")",
type: "POST",
contentType: "application/json;odata=verbose",
data: JSON.stringify(itemProperties),
headers: {
"Accept": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
"X-HTTP-Method": "MERGE",
"If-Match": '*'
},
success: function (data) {
success();
},
error: function (data) {
failure(data);
}
});
It is throwing below error:
A type named 'SP.Data.WP_x005f_DocumentsListItem' could not be resolved by the model. When a model is available, each type name must resolve to a valid type
Can someone please help me with this?
SP.Data.WP_x005f_DocumentsListItem
is correct? You can find by a GET request to/_api/Web/Lists/getbytitle('List Name')/ListItemEntityTypeFullName
ListItemEntityTypeFullName
as far as I know nishantrana.me/2013/10/03/…