Open
Description
Hi All,
I am trying to get get a list of all files in a given Folder including meta data fields.
When I run a REST call, I can see the returned data includes all meta properties in the ListItemAllFields:
/sites/test_site/_api/web/GetFolderByServerRelativeUrl('/folder_url')/Files?$expand=ListItemAllFields
I am trying to do this with the following code but I am unable to retieve the ListItemAllFields for the files as well.
If collect the ListItemAllFields for each file one by one, it works but this for my target folder this takes about 15 minutes while the above REST call takes about 5 seconds.
ctx = get_sharepoint_context_using_user()
target_folder_url = "folder_url"
root_folder = ctx.web.get_folder_by_server_relative_path(target_folder_url).expand(['listItemAllFields'])
files = root_folder.get_files(True).execute_query()
files[0].listItemAllFields.get_property('properties')
How can I accomplish this?