2

I have a SPO site with some DocumentSets having different ContentType. I need to get "Allowed Content Types" of any DocumentSet to take a decision: I get my DocumentSet as ListItem or as Folder or as DocumentSet (Microsoft.SharePoint.Client.DocumentSet) but, in any form it is, I can't find a way to reach the allowed Content Types, any advice?

Thanks in advance.

1 Answer 1

2

You should be able to get it through the UniqueContentTypeOrder property. Here's the part of the code that I used in one of the proejcts to get those values:

var docset = web.GetFolderByServerRelativeUrl("DOCUMENTSETURL");
context.Load(docset);
context.Load(docset, l=> l.UniqueContentTypeOrder); 
context.ExecuteQuery();

foreach(var ctid in docset.UniqueContentTypeOrder)
{
    Console.WriteLine(ctid);
}    

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.