{"id":11061,"date":"2024-01-24T09:10:21","date_gmt":"2024-01-24T08:10:21","guid":{"rendered":"https:\/\/help.metashare.com\/?page_id=11061"},"modified":"2025-06-02T16:21:05","modified_gmt":"2025-06-02T14:21:05","slug":"how-to-set-columns-visibility-in-properties-form","status":"publish","type":"page","link":"https:\/\/help.metashare.com\/en\/metashare\/get-started\/metadata\/how-to-set-columns-visibility-in-properties-form\/","title":{"rendered":"How to set column&#8217;s visibility in properties form"},"content":{"rendered":"\n<p>SharePoint fields can set to <a href=\"https:\/\/help.metashare.com\/en\/metashare\/get-started\/metadata\/how-to-define-mandatory-columns\/\">Hidden, Optional or Required<\/a>. 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 &#8220;<code>ShowInNewForm<\/code>&#8221; and &#8220;<code>ShowInEditForm<\/code>&#8221; 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.<\/p>\n\n\n\n<p>Unfortunately there is no user interface in SharePoint to change these settings for a column. The &#8220;<code>ShowInNewForm<\/code>&#8221; and &#8220;<code>ShowInEditForm<\/code>&#8221; properties can however be set if you create the columns programmatically, using <a href=\"https:\/\/learn.microsoft.com\/en-us\/sharepoint\/dev\/schema\/field-element-field\" data-type=\"link\" data-id=\"https:\/\/learn.microsoft.com\/en-us\/sharepoint\/dev\/schema\/field-element-field\" target=\"_blank\" rel=\"noreferrer noopener\">field schema XML<\/a>, or they can be modified with PowerShell.<\/p>\n\n\n\n<div class=\"wp-block-group has-accent-2-background-color has-background\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<h2 class=\"wp-block-heading\">Get started with PnP Powershell<\/h2>\n\n\n\n<p>This page contains code snippets for PnP PowerShell, a module from the Patterns and Practices community with many useful commands for managing Microsoft 365.<\/p>\n\n\n\n<p>To get started you need to:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><a href=\"https:\/\/learn.microsoft.com\/en-us\/powershell\/scripting\/install\/installing-powershell-on-windows\" target=\"_blank\" rel=\"noreferrer noopener\">Install PowerShell 7<\/a> on your machine<\/li>\n\n\n\n<li><a href=\"https:\/\/pnp.github.io\/powershell\/articles\/installation.html\" target=\"_blank\" rel=\"noreferrer noopener\">Install the PnP.PowerShell module<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/pnp.github.io\/powershell\/articles\/registerapplication.html\" target=\"_blank\" rel=\"noreferrer noopener\">Register an app in Entra ID<\/a> that PnP.PowerShell can use for authentication <\/li>\n\n\n\n<li>Start PowerShell 7 from the start menu (or run pwsh.exe). PnP.PowerShell is imported automatically.<\/li>\n\n\n\n<li>Connect to your SharePoint site using:<br><code>Connect-PnPOnline `<br>-Interactive `<br>-Url \"https:\/\/[tenant].sharepoint.com\/\" `<br>-ClientId \"[Your PnP PowerShell App Id, found in Azure Portal]\"<\/code><\/li>\n\n\n\n<li>Run any of the available <a href=\"https:\/\/pnp.github.io\/powershell\/cmdlets\/index.html\">commands<\/a><\/li>\n<\/ol>\n<\/div><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Set ShowInNewForm and ShowInEditForm <\/h2>\n\n\n\n<p>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:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Modify following values as needed\n$ContentTypeHubUrl = \"https:\/\/&#91;tenant].sharepoint.com\/sites\/contentTypeHub\"\n$PnPPowerShellClientId = \"&#91;Your PnP PowerShell App Id, found in Azure Portal]\"\n$FieldInternalName = \"SomeField\"\n$ShowInNewForm = $false\n$ShowInEditForm = $true\n\n# Connect to your tenant's content type hub\nConnect-PnPOnline `\n-Interactive `\n-ClientId $PnPPowerShellClientId `\n-Url $ContentTypeHubUrl\n\n# Get and update the field\n$field = Get-PnPField -Identity $FieldInternalName\n$field.SetShowInNewForm($ShowInNewForm)\n$field.SetShowInEditForm($ShowInEditForm)\nInvoke-PnPQuery<\/code><\/pre>\n\n\n\n<p>For the changes to be visible in the workspaces\/sites, you will need to <a href=\"https:\/\/help.metashare.com\/en\/metashare\/get-started\/metadata\/how-to-publish-unpublish-a-site-content-type\/\">republish<\/a> the content types where these columns are being used.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8230; <a title=\"How to set column&#8217;s visibility in properties form\" class=\"read-more\" href=\"https:\/\/help.metashare.com\/en\/metashare\/get-started\/metadata\/how-to-set-columns-visibility-in-properties-form\/\" aria-label=\"Read more about How to set column&#8217;s visibility in properties form\">Read more<\/a><\/p>\n","protected":false},"author":9,"featured_media":0,"parent":10709,"menu_order":11,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":{"0":"post-11061","1":"page","2":"type-page","3":"status-publish","5":"no-featured-image-padding"},"_links":{"self":[{"href":"https:\/\/help.metashare.com\/en\/wp-json\/wp\/v2\/pages\/11061","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/help.metashare.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/help.metashare.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/help.metashare.com\/en\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/help.metashare.com\/en\/wp-json\/wp\/v2\/comments?post=11061"}],"version-history":[{"count":20,"href":"https:\/\/help.metashare.com\/en\/wp-json\/wp\/v2\/pages\/11061\/revisions"}],"predecessor-version":[{"id":12202,"href":"https:\/\/help.metashare.com\/en\/wp-json\/wp\/v2\/pages\/11061\/revisions\/12202"}],"up":[{"embeddable":true,"href":"https:\/\/help.metashare.com\/en\/wp-json\/wp\/v2\/pages\/10709"}],"wp:attachment":[{"href":"https:\/\/help.metashare.com\/en\/wp-json\/wp\/v2\/media?parent=11061"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}