0

I can't quite remember how to expand a field of a folder or file. Example: I can do something like Folders/ListItemAllFields/RoleAssignments/Member to expand the role assignments, but I cannot do this for my custom column.


Details

  • Document Library has a column called "Authors"
  • The column is a multiple person or group
  • The column appears as an AuthorsId field in the JSON response

REST API URL:
/_api/web/GetFolderByServerRelativeUrl('/sites/<name>/Documents')?$expand=Folders/ListItemAllFields

odata=nometadata (response):

[ { ListItemAllFields:
     { FileSystemObjectType: 1,
       ...,
       AuthorsId: [ 2, 3, 5, 8 ]
     },
   Name: 'My Folder Name',
   ItemCount: 20,
   ...
  },
  ...
]

Failures

This is just more info in attempts I've made that result in Bad Request failures:

  • Folders/ListItemAllFields/Authors/Id
  • Folders/ListItemAllFields/Authors

Folders/ListItemAllFields/AuthorsId does not result in failure, but doesn't expand the resulting array either

Mike
  • 1,279
  • 7
  • 18
  • Are you able to use the list endpoint instead? Something like `/_api/web/lists/GetByTitle('Documents')/items?$expand=Authors&$select=Authors/Title&$filter=Authors ne null` seems like it should work. – Thriggle Jun 08 '20 at 20:53
  • @Thriggle sorry I never responded. I didn’t see the notification or accidentally clicked early and never came back to it. I’m not sure where this stands. I don’t think I found a solution and queried siteusers, but I am not positive about that. I’ll have to check (if I remember) when I return to that code, probably in the new year. Thanks for your comment all the same! – Mike Dec 24 '20 at 07:18

0 Answers0