1

I have the "Goods" folder which I can access with the following endpoint:

https://***.sharepoint.com/sites/***/_api/web/GetFolderByServerRelativeUrl('/sites/***/Goods/')

If I expand the above folder with Folders, I can get a list of all the folders within "Goods":

https://***.sharepoint.com/sites/***/_api/web/GetFolderByServerRelativeUrl('/sites/***/Goods/')?$expand=Folders

However, the above endpoint has no properties. For example. Each folder inside Goods has a "Status" column that is missing in the response I get. I don't want to iterate over each folder to get the value of the Status column.

Is there a way to get all properties from the folders inside "Goods" in a single request?

I have tried using expand and select, but it didn't work as expected. What am I missing?

https://***.sharepoint.com/sites/***/_api/web/GetFolderByServerRelativeUrl('/sites/***/Goods/')?$expand=Folders&$select=Folders/ID,Folders/Status,Folders/Step

1 Answer 1

1

Try adding ListItemAllFields to $expand to get additional details from folders like:

https://***.sharepoint.com/sites/***/_api/web/GetFolderByServerRelativeUrl('/sites/***/Goods/')/folders?$expand=Folders,ListItemAllFields

OR (update from comments):

https://***.sharepoint.com/sites/***/_api/web/GetFolderByServerRelativeUrl('/sites/***/Goods/')/folders?$expand=ListItemAllFields

Reference: SharePoint REST get column LikedBy with method GetFolderByServerRelativeUrl to library

2
  • Thank you very much for you quick reply. The code in the reference you mentioned made me realize I wanted the folders within GOODS, so I needed "/folders in my url. Then expanding with ?$expand=ListItemAllFields did the trick! I leave the full url to help people who may stumble upon this post: https://***.sharepoint.com/sites/***/_api/web/GetFolderByServerRelativeUrl('/sites/***/Goods/')/folders?$expand=ListItemAllFields
    – Marcos
    Commented May 13, 2022 at 14:11
  • Great, glad it worked for you. I have updated my answer accordingly. Commented May 13, 2022 at 14:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.