Custom columns to automatically appear in the Documents section

Copper Contributor

Hi All,

I have created a PowerShell script that adds custom columns, join a site to the Project Hub and set regional settings. However, I am experiencing issues with the custom columns. I can see the custom columns that have been added via the PowerShell script under Site Settings >> Site Columns, but I would like to be able to see them in the Documents section automatically once I have created a new site. Is there any way to achieve that?

Any help would be highly appreciated!

7 Replies
Do you mean in the "Documents" section in the Site Columns page? How are you provisioning the site columns?

I am talking about The “Documents” section on the left navigation bar in every created site in SharePoint. See the screenshot for reference.
documents section.pngBasically I create a new team site by using a template which is based on my PowerShell script. As you can see below, my script is being executed and the various actions are being applied.
script-execution.png

However,  once the script execution has finished, I can't see the custom columns in the Documents tab.

Ok, I see what you are doing...you have create a site script that is applied to the site you have created and you are missing the part where the columns are added to the document library...without the site script details, it seems this part is not included in the script and the result you should get is that when you clic on Documents in the navigation menu, you will see the columns added to the document library

Yes, but how exactly do I do that? I did research this, but could not find much about it. Here is my script:

script.png

And to be more precise, you will have to use the addSiteColumn operation:

{
"verb": "addSiteColumn",
"internalName": "siteColumnUser"
}

Great, thank you, will give it a go.