SOLVED

Configure default Office 365 Label for library

MVP

In the Library UI it's possible to set a default compliance tag for a library using the hold.aspx page that is exposed through the "Apply a label to items in this library" option in the library settings menu.

 

ApplyLabel.jpg

 

We can set an item to have a particular compliance tag through CSOM, but I can't see anywhere in the CSOM library that allows us to configure the default for an entire library.

 

I'm in the process of configuring a large DMS solution for a client and having the ability to set this through CSOM or PoSH would save an immense amount of time.

 

Paul.

11 Replies

We're currently implementing a DMS too and this was also a requirement for us. I've checked the possibilities last week. Unfortonately, CSOM currently doesn't provide a way to set this property at the library-level (only at Item-level like you said). I've noticed (after configuring though the browser) the property is ultimately stored in the List's Schema XML but CSOM doesn't provide a way to modify this Schema directly.

 

I bet for now your only option to modify this setting in an automated way, would be through the HTTP Remote Operation pattern described in @Vesa Juvonen's blog below:

https://blogs.msdn.microsoft.com/vesku/2013/11/04/ftc-to-cam-advance-http-remote-operations-for-sp20...

 

And also:

https://www.youtube.com/watch?v=eoLIDCZgMH4

 

I was hoping to avoid screen scraping if possible but it was going to be my fall back option. It’s just a little messy and prone to issues.

Hopefully a fully supported option will be added to csom and other methods soon.

Paul.
Hi,
Where in the list schema are you seeing this? I cannot see any changes to the schemaxml after setting the value back and forth.

After changing the setting at the library-level I noticed a ComplianceTag attribute appearing in the SchemaXml

 

Untitled.png

Found it now :) Doesn't help though. Guess the List CSOM object have to expose the ComplianceTag property. Or expose a method in Microsoft.Office.Client.Policy for setting this.  cc @Vesa Juvonen

This property is not indeed exposed from the List using CSOM or REST. ComplianceTag can be found at the ListItem level, but that's not really what's being looked here. Basically, that means that there's no API to currently set this property for the List object. 

best response confirmed by Paul Hunt - Cimares (MVP)

cheers @Mikael Svenson, upvoting now!

An old topic, but I forgot to come back and say it's been done.. the Uservoice has been updated.

 

Kudos to the MS dev team for switching this on so quickly!

 

Paul.

@Vesa Juvonen How can I use those new methods in the updated CSOM if I don't have developer tools such as VS installed?  (I'm not a dev) - do I have to wait for the Client Components SDK to be updated? 

Hi Rob,

 

You could look at installing the command line version of NUGET. This allows you to always pull down the latest version of DLLs without having to update the SDK.

 

https://www.nuget.org/packages/Microsoft.SharePointOnline.CSOM

 

That link shows the latest versions that are registered with Nuget. The Nuget tool itself is pretty simple to use if you're ok with PowerShell/cmd line stuff.

 

https://docs.microsoft.com/en-us/nuget/tools/nuget-exe-cli-reference

 

Nice write up there on setting it up.

 

Paul.