Get properties of a SharePoint List Item since Python

Charles Elie Gentil 0 Reputation points
2025-04-18T10:35:33.07+00:00

Dear all,

I would like to get the properties of a specific item inside a Sharepoint list.
I'm working with the latest version of Office365-REST-Python-Client.

I can do that with get_items() function, but not with get_item_by_id() or get_item_by_unique_id()

Could you help me ?

Thanks in advance.

Here my code and some comments :

ctx_test = ctx(list_url,user)
list_test = ctx_test.web.lists.get_by_title(list1)

items = list_test.get_items().execute_query()
print(items)
print(items[0].properties["ID"], items[0].properties["Title"]) ## This part correctly works

item = list_test.get_item_by_id(2).execute_query()
print(item.properties["ID"], item.properties["Title"]) ## Not this one

'''
the error message is : 
print(item.properties["ID"], item.properties["Title"]) ~~~~~~~~~~~~~~~^^^^^^ KeyError: 'ID'

'''
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
3,600 questions
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.