Jan 16 2019 02:45 PM
Hi!
I am trying to add a new choice option to a Choice site column in SharePoint Online using SharePoint REST API. The choice site column is added to a content type and the content type is added to a SharePoint List.
While I am able to add a new choice option to the site column using below REST API, the changes are not pushed to the SharePoint List when updating a site column. Am I missing something here or is there a way to trigger the update to push the changes to all list columns based on this site column?
REST EndPoint - https://abc.sharepoint.com/_api/web/fields('guid')
Body - {"__metadata": {"type": "SP.FieldChoice"},
"Choices": {"__metadata": {"type": "Collection(Edm.String)"},
"results": ["Choice1",
"Choice2",
"Choice3",
"Choice4",
"New Choice"]
}}
CSOM has updateAndPushChanges method to trigger the update. However I am unable to find equivalent REST endpoint.
https://abc.sharepoint.com/_api/web/fields('guid')/updateandpushchanges(true) returns the following
{
"error": {
"code": "-1, Microsoft.SharePoint.Client.ResourceNotFoundException",
"message": {
"lang": "en-US",
"value": "Cannot find resource for the request updateAndPushChanges."
}
}
}
Jan 17 2019 12:00 AM
Hi @Sandy5k,
The GUID is a protected column. I found an interesting tutorial for you with several steps to use it anyway, look at this.
Hope that helps. Greets, Eva.
Jan 17 2019 09:53 AM
Hi @Eva Vogel
Thank you for the response. However I am looking for updating a site column and pushing the changes to the Lists based on the site column using REST API.
Mar 28 2019 06:49 PM