Search code examples
sharepoint-onlineonedrivemicrosoft365pnp.powershell

Use Column Formatting in a custom column in OneDrive for Business


We are trying to create a custom column in the users' OneDrives to display some information reflecting applied retention labels. We achieved to create the colum through PnP.PowerShell and also apply CustomFormatter property with a format that also works on SharePoint Online sites.

Unfortunately the column shows just empty, the custom formatting seems not to be applied.

Digging a bit deeper, I found that custom formatting in SPO creates a div in the fields content with the class "sp-field-customFormatter". This doesn't happen in OfB, so I think that custom column formatting is not working in OfB as the needed scripts don't get loaded.

Can anyone confirm that or tell me that I am mistaken? ;)


Solution

  • Unfortunately, column formatting is a feature that can be used to customize how fields in SharePoint lists and libraries are displayed. However, it is not supported in OneDrive for Business. The custom formatting scripts do not get loaded in OneDrive for Business, which results in the custom column not being displayed as expected.