Hi, can anyone tell me if its possible to 'POST' the creation of multiple fields (columns) using ajax REST call. At the moment, I can only POST one field at a time. I have tried the code below and it will only show the last field 'Field4'
ie
$.ajax({
url: metadatauri + "/fields",
type: "POST",
headers: {
"accept": "application/json;odata=verbose",
"X-RequestDigest": $("#__REQUESTDIGEST").val(),
"X-Http-Method": "POST",
"content-type": "application/json;odata=verbose"
},
data:JSON.stringify( {'__metadata': { 'type': 'SP.Field' }, 'Title': 'Field1', 'FieldTypeKind': 3 ,
'__metadata': { 'type': 'SP.Field' }, 'Title': 'Field2', 'FieldTypeKind': 3 ,
'__metadata': { 'type': 'SP.Field' }, 'Title': 'Field3', 'FieldTypeKind': 3 ,
'__metadata': { 'type': 'SP.Field' }, 'Title': 'Field4', 'FieldTypeKind': 3 ,
'__metadata': { 'type': 'SP.Field' }, 'Title': 'Field4', 'FieldTypeKind': 3 }),
success: function () {
},
error: function (err)
{
alert(err);
}
});
Many thanks
Arty