Changelog
-
SharePoint API: improved support for a file and folders addressing details
-
SharePoint API: support for saving taxonomy columns #353
Example: save a single-valued taxonomy field value
ctx = ClientContext(site_url).with_credentials(credentials)
tasks_list = ctx.web.lists.get_by_title("Tasks")
tax_field_value = TaxonomyFieldValue("{term-label}", "{term-guid}")
item_to_create = tasks_list.add_item({
"Title": "New task",
"{tex-column-name}": tax_field_value,
}).execute_query()
Example: save a multi-valued taxonomy field value
ctx = ClientContext(site_url).with_credentials(credentials)
tasks_list = ctx.web.lists.get_by_title("Tasks")
tax_field_value = TaxonomyFieldValue("{term-label}", "{term-guid}")
tax_field_values = TaxonomyFieldValueCollection([tax_field_value])
item_to_create = tasks_list.add_item({
"Title": "New task",
"{tex-column-name}": tax_field_values,
}).execute_query()