Forum Discussion
Aynes Bekir
Aug 10, 2018Copper Contributor
Custom columns to automatically appear in the Documents section
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 se...
Aynes Bekir
Aug 10, 2018Copper Contributor
I am talking about The “Documents” section on the left navigation bar in every created site in SharePoint. See the screenshot for reference.
Basically 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.
However, once the script execution has finished, I can't see the custom columns in the Documents tab.
Aug 10, 2018
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
- Aynes BekirAug 10, 2018Copper Contributor
Yes, but how exactly do I do that? I did research this, but could not find much about it. Here is my script:
- Aug 10, 2018Check the Site scripts documentation where you can see how to add columns to a list / document library: https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-overview and this is the JSON schema: https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-json-schema
- Aug 10, 2018And to be more precise, you will have to use the addSiteColumn operation:
{
"verb": "addSiteColumn",
"internalName": "siteColumnUser"
}