SharePoint fields can set to Hidden, Optional or Required. Fields that are set to hidden are never shown in the property forms, but Optional or Required can also set to be shown or hidden in the property forms by setting the “ShowInNewForm
” and “ShowInEditForm
” properties. MetaShare respects these SharePoint settings and will show or hide fields in document/workspace properties, during document/workspace creation or when properties are edited.
Unfortunately there is no user interface in SharePoint to change these settings for a column. The “ShowInNewForm
” and “ShowInEditForm
” properties can however be set if you create the columns programmatically, using field schema XML, or they can be modified with PowerShell.
Get started with PnP Powershell
This page contains code snippets for PnP PowerShell, a module from the Patterns and Practices community with many useful commands for managing Microsoft 365.
To get started you need to:
- Install PowerShell 7 on your machine
- Install the PnP.PowerShell module
- Register an app in Entra ID that PnP.PowerShell can use for authentication
- Start PowerShell 7 from the start menu (or run pwsh.exe). PnP.PowerShell is imported automatically.
- Connect to your SharePoint site using:
Connect-PnPOnline `
-Interactive `
-Url "https://[tenant].sharepoint.com/" `
-ClientId "[Your PnP PowerShell App Id, found in Azure Portal]" - Run any of the available commands
Set ShowInNewForm and ShowInEditForm
This is how you set the visibility of a field in the property forms, using PnP.Powershell script, when the columns are in the content type hub:
# Modify following values as needed
$ContentTypeHubUrl = "https://[tenant].sharepoint.com/sites/contentTypeHub"
$PnPPowerShellClientId = "[Your PnP PowerShell App Id, found in Azure Portal]"
$FieldInternalName = "SomeField"
$ShowInNewForm = $false
$ShowInEditForm = $true
# Connect to your tenant's content type hub
Connect-PnPOnline `
-Interactive `
-ClientId $PnPPowerShellClientId `
-Url $ContentTypeHubUrl
# Get and update the field
$field = Get-PnPField -Identity $FieldInternalName
$field.SetShowInNewForm($ShowInNewForm)
$field.SetShowInEditForm($ShowInEditForm)
Invoke-PnPQuery
For the changes to be visible in the workspaces/sites, you will need to republish the content types where these columns are being used.