I am trying to update a Sharepoint list using shareplum. I am able to read information but for some reason I am not able to add a new list item. What is going wrong here?
from shareplum import Site
from requests_ntlm import HttpNtlmAuth
# variables
username = "myusername"
password = "mypassword"
site_url = "https://mycompansharepointsite.org/sites"
domain = "myCompanyDomain"
my_list_name = "listTitle"
my_data = [{
'Project_Field': 'TESTING'
}]
cred = HttpNtlmAuth(f'{domain}\\{username}', password)
site = Site(site_url, auth=cred)
mylist = site.List(my_list_name, exclude_hidden_fields=True)
incoming_list.UpdateListItems(data=my_data, kind='Update')
For example, after importing the library and declaring the variables to log me in, these lines work to read the Sharepoint list:
sp_list = site.List(my_list_name)
data = sp_list.GetListItems()
print(data)
I've thought maybe I need to use a different library like Office365-REST-Client but I thought, since I finally figured out how to get this far to read a Sharepoint list using shareplum, I would exhaust my resources before going down another rabbit hole.