2

I'm doing a provider-hosted app and I'm trying to get custom column I've created in a content type that inherits from folder(parent) I get the folder like so:

 Folder folder = clientContext.Web.GetFolderByServerRelativeUrl(pathForfolder);
            clientContext.Load(folder);
            clientContext.ExecuteQuery();

How can i get all the fields for a folder?

e.g var name = folder["field"]

thanks

1 Answer 1

5

Use Folder.ListItemAllFields property to retrieve folder associated list item properties

Example

Folder folder = ctx.Web.GetFolderByServerRelativeUrl(folderUrl);
ctx.Load(folder,f => f.ListItemAllFields);
ctx.ExecuteQuery();

Console.WriteLine(folder.ListItemAllFields["Title"]);

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.