Closed phhoef closed 9 months ago
I believe you should update list item instead of file's property bags (which is different, key value pairs).
Something like:
item, err := web.GetFile("/Shared Documents/A File.txt").GetItem()
if err != nil {
t.Error(err)
}
_, err = item.Update([]byte(`{
"ContentTypeId": "0x010100B4CBD48E8F4F4BA4B8DCCD2A6A7A3E6A",
"Title": "Updated Title"
}`))
thanks @koltyakov! That was exactly, what I was looking for 😄 works like a charm ...
I am uploading a file to SPO and I want to change the document type and set a few specific props of that type. Setting the props are completely ignored, though no error is returned.
Neither the ContentTypeId changed nor the properties are applied. Is something wrong with my code?