Office365-REST-Python-Client
Office365-REST-Python-Client copied to clipboard
List item system_update does not update item
Hi all, I've been doing some stuff with SharePoint lists and items, but unfortunately I am facing an issue that can be solved through a workaround. However I was wondering if there is a better way. To simplify the scenario, I would summarize this question to:
- We have an item that needs to update a column (ideally a column starting with underscore i.e. __test that is transformed into OData___test, but for the sake of this test we can assume it is called "test").
- The update cannot modify version history, editor, modification date, etc. ONLY the mentioned column.
- The column should be a datetime column but we can assume it is a text property.
- I'm using version is 2.5.9.
My code is:
sp_item = self.list.items.get_by_id(id)
property_name = "test"
property_value = "whatever"
sp_item = sp_item.set_property(property_name, property_value).system_update()
sp_item.context.load(sp_item)
sp_item.context.execute_query()
The expected result is to have sp_item.get_property(property_name) equal to property_value, but it is None. Any idea why this is not working as expected? I was looking at the samples, but this method does not have too much information.
PS: My workaround is to use validate_update_list_item overriding Modified and Editor with the current values, but I was wondering why system_update does not update the item.