0
votes

I'm using Sharepoint Online.

I have a column in a list that is currently "Multiple lines of text". If I try to use the SP UI and manually alter the Column Type to "Single Line of Text" I get "unsupportedFieldTypeError".

If I use Sharepoint Designer 2013, and access the list and try to click "Column Type" when I highlight this column, nothing happens.

I would really like to know if I can create a new column that is a "Single line of text" that just copies the value of this "Multiple lines of text" column?

Thanks!

1

1 Answers

0
votes

You can create a new Single Line Text field and copy field value using PnP PowerShell below:

#Parameters
$SiteURL = "https://zheguo.sharepoint.com/"
$ListName = "JqueryList"
$SourceColumn = "MultiField" #Internal Name of the Fields
$DestinationColumn = "SingleField"

#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Credential Get-Credential

#Get all items from List
$ListItems = Get-PnPListItem -List $Listname

#Copy Values from one column to another
ForEach ($Item in $ListItems)
{
    Set-PnPListItem -List $Listname -Identity $Item.Id -Values @{$DestinationColumn = $Item[$SourceColumn]}
}

Result:

enter image description here

Before using the PowerShell, please install PnP PowerShell here:

pnp/PnP-PowerShell

Reference:

SharePoint Online: Copy Values from One Column to Another using PowerShell