'Getting username from a multi-valued lookup field in Sharepoint List
I am working with a Sharepoint List via REST API, managed to get all of the string value datas, but having problems when it comes to multi-valued User/Lookup field values.
This is the code I am currently using:
from office365.runtime.auth.user_credential import UserCredential
from office365.sharepoint.client_context import ClientContext
site_url = "https://xxx.sharepoint.com/sites/xxx/"
sp_list = "xxx"
ctx = ClientContext(site_url).with_credentials(UserCredential("xxx", "xxx"))
sp_lists = ctx.web.lists
s_list = sp_lists.get_by_title(sp_list)
l_items = s_list.get_items()
ctx.load(l_items)
ctx.execute_query()
for item in l_items:
print(item.properties["mvlf"])
In this case the "mvlf" value in the last line of code is a multi-valued lookup field that contains all the user data (username, email, etc) but I am only getting the id number.
Any help would be great!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
