Hi,
Do this -
1) After saving the attachment to SharePoint, call Update file properties with the Created file’s ID and set your columns there.
2) If columns don’t appear, or for managed metadata/locked files, use HTTP:
- Method: POST
- Uri: _api/web/lists/getbytitle('LibraryName')/items(ItemID)/validateUpdateListItem()
- Headers: accept: application/json;odata=verbose, content-type: application/json;odata=verbose
- Body:
{
"formValues":[
{"FieldName":"Title","FieldValue":"Inactive Users April"},
{"FieldName":"Status","FieldValue":"Processed"},
{"FieldName":"Dept","FieldValue":"IT"},
{"FieldName":"MMColumn","FieldValue":"Term Name|<TermGUID>"}
],
"bNewDocumentUpdate": true
}
Notes:
- Managed metadata requires Term Name|TermGUID.
- validateUpdateListItem works when files are checked out/need approval.
- If you copied the file, get destination Item ID via Get file properties, then update.