Convert an existing plain text note field/column to rich text
If you create a SharePoint site column (a note field in this case), associate it with a site content type, and then associate that content type with a list in a sub site, the site column will be available on that library. Obviously right?
However, when you update the site column (and push all changes to lists and libraries) not *all* of the changes you make are in fact pushed down. An example of this is the setting that dictates whether a note field should allow rich text or enforce plain text. If you change this setting at the site column level it will *not* propagate to libraries which already exist. New instances of the column (say if you associated the content type with a list for the first time) will be configured correctly, but existing list-level instances are not updated. NOTE: This is only true for properties specific to particular column type; common properties such as ‘required’ will be pushed down to existing instances of the column at the list level.
Configuring a SharePoint note field
So you want to change a list-level instance of a plain text note column to a rich text note column (or vice-versa, or otherwise change column specific properties or another field type)? You need to do it for every list where the column is in use. That would be very tedious to do via the SharePoint UI, but you can’t anyway. The UI only supports changing the set of common field properties (type, required, hidden, etc).
In comes PowerShell. Below you will find a script which updates a plain text note column to be a rich text note column. It is important to note that this script only updates the list-level columns and not the site column. This means that after running the script, new instances will continue to inherit the site column configuration.
The script is written for SharePoint Online (and assumes that the SharePoint Online Client Components SDK is installed) but for this to work on-premises you would only need to update the referenced assemblies (v15 for 2013) and modify the code which passes the credentials.
As a developer my professional interests are technical and tend to be SharePoint focused. I've been working with SharePoint since 2009 and hope my posts will give back a little to the community that's supported me over this time. I'm also a keen runner (half-marathon) and passionate Brompton bicycle owner.
View all posts by Paul Ryan
2 thoughts on “Convert an existing plain text note field/column to rich text”
Hi Paul, thanks for posting this. I get this error in PowerShell. SharePoint Online Client Components SDK is installed.
Unable to find type [Microsoft.SharePoint.Client.Web]: make sure that the assembly containing this type is loaded.
At line:45 char:1
+ [Action[Microsoft.SharePoint.Client.Web]]$updateListField =
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Microsoft.SharePoint.Client.Web:TypeName) [], ParentContainsErrorRecordExc
eption
+ FullyQualifiedErrorId : TypeNotFound
Try running the script using the SharePoint Online Management Shell rather than a standard PowerShell window. This will have been installed along with the components. Otherwise you are required to load the Microsoft.SharePoint.Client and Microsoft.SharePoint.Client.Runtime assemblies explicitly in the script. Take a look at Chris Obrien’s post here: http://www.sharepointnutsandbolts.com/2013/12/Using-CSOM-in-PowerShell-scripts-with-Office365.html
Hi Paul, thanks for posting this. I get this error in PowerShell. SharePoint Online Client Components SDK is installed.
Unable to find type [Microsoft.SharePoint.Client.Web]: make sure that the assembly containing this type is loaded.
At line:45 char:1
+ [Action[Microsoft.SharePoint.Client.Web]]$updateListField =
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (Microsoft.SharePoint.Client.Web:TypeName) [], ParentContainsErrorRecordExc
eption
+ FullyQualifiedErrorId : TypeNotFound
Try running the script using the SharePoint Online Management Shell rather than a standard PowerShell window. This will have been installed along with the components. Otherwise you are required to load the Microsoft.SharePoint.Client and Microsoft.SharePoint.Client.Runtime assemblies explicitly in the script. Take a look at Chris Obrien’s post here: http://www.sharepointnutsandbolts.com/2013/12/Using-CSOM-in-PowerShell-scripts-with-Office365.html