My home on the internet to share all of my SharePoint battles with the world

Powershell: How to convert a ‘Single line of Text’ column to ‘Multi-line of Text’

Powershell: How to convert a ‘Single line of Text’ column to ‘Multi-line of Text’

  • Comments 2
  • Likes

Problem: Customer needed a way, via PowerShell to convert a column from single line of text to Multi-line of text. I first verified that the column they were trying to convert was not the default ‘Title’ column, I would not recommend touching that one. The customer had run into an issue where the Single Line of text column’s 255 character limit was truncating some entries.


$web=Get-SPWeb "http://nameOfSite"

$list = $web.Lists["NameOfList"]

$column = List.Fields["ColumnName"]

$script:noteFieldType = [Microsoft.SharePoint.SPFieldType]::Note

$column.Type = $noteFieldType



NOTE: Remember to run these scripts with the correct permissions. When the customer ran it the first time, they had some vague errors like 'Cannot index into a null array'. Found out they were logged into the server as themselves, once they logged in as a farm account, the script worked fine.

Fight Comparison:
Mike Tyson Vs. Carl ‘The Truth’ Williams…easy KO

  • I have found that just changing the $column.type doesn't quite do enough when changing from a single line to a note type. Some of the parameters still looked like they were coming from a text field instead of a note field. The trick turned out to be also entering the new $column.SchemaXml information, then the full field updated the type correctly

  • @Michael, how did you go about changing the schemaxml? Did you extract it and update some tags then just $column = $modifiedXml? If so then what tags where required? Thanks for a great post!

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment