O365 / python-o365

A simple python library to interact with Microsoft Graph and Office 365 API
Apache License 2.0
1.67k stars 423 forks source link

add/modify Sharepoint Document library column value #485

Open manasimahajann opened 4 years ago

manasimahajann commented 4 years ago

Good evening!

We were trying to build our own api classes using this example.

I was wondering if there is a way we could get/modify column value information of a document library in SharePoint?

Thank you, Manasi

Vilsepi commented 4 years ago

Did you figure this out yet? I've managed to upload a file to Sharepoint, and update its name and description, but not our custom columns. According to the comment here, you can only update the name and description for now: https://github.com/O365/python-o365/blob/c80eeda5d22dfcf8cb1402f486d122a7d4f35b4b/O365/drive.py#L628

Any way to update values for custom columns?

Vilsepi commented 4 years ago

I was finally able to solve my problem.

First, I upload a file via upload_file from the Drive component, and then update its fields via update_fields from the Sharepoint component. After that you'll also have to call the save_updates for that item.