0

Recently we migrated few sites from SharePoint 2010 to SharePoint online. The source site had few managed metadata columns. For each of these columns, SP2010 had created a Single line of text column with a _0 suffix. For example, if the managed metadata column name is Location, then it also had a location_0 column.

In the source this column is hidden and it is not showing up in the Edit form, but in the destination, these columns are showing up in the edit form for the same content type

Is there a way to edit the Edit form? I can see these column only in SharePoint designer but I don't have any option to make them hidden

2 Answers 2

1

If you can execute PnP PowerShell script, you can hide columns from appearing in the forms like:

Import-Module -Name SharePointPnPPowerShellOnline -Verbose

$cred= Get-Credential

#Config Variables
$SiteURL = "https://mytenant.sharepoint.com/sites/testing/"
 
#Connect to PnP Online 
Connect-PnPOnline -Url $SiteURL -Credentials $cred 

$list = Get-PnPList -Identity Lists/Contact
$customfield=Get-PnPField -List $list -Identity "Title"

#Hide the Field
$customfield.SetShowInNewForm($false) 
$customfield.UpdateAndPushChanges($true)
$customfield.Context.ExecuteQuery()

For setting up PnP PowerShell, refer to MS Article

1

The method to set whether the column is displayed in the edit form should be SetShowInEditForm.

$username = "[email protected]"
$password = "Password"
$cred = New-Object -TypeName System.Management.Automation.PSCredential -argumentlist $userName, $(convertto-securestring $Password -asplaintext -force)
Connect-PnPOnline -Url https://contoso.sharepoint.com/sites/dev -Credentials $cred
$field=Get-PnPField -List "listname" -Identity "column"
$field.SetShowInEditForm($false)
$field.Update()

To check if the update takes effects, look for ShowInEditForm="FALSE" in schema xml

$field.SchemaXml

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.