Sep 05 2018 11:12 AM - edited Sep 06 2018 12:21 AM
Hello,
I am using site design {Schema documentation} to create new sites. Expecting new sites created from site design will have site columns, Content types and Lists. I able to provision column, content type and list but facing issue with site column type "TaxonomyFieldTypeMulti".
I would like to associate column with existing Term in my tenant. In On premise we can do this association on feature activation but in office 365 we have limitations. Please suggest code or alternative.
code is as below :
1st Attempt [tried PnP site template style]--
{
"verb": "createSiteColumnXml",
"schemaXml": "<Field ID=\"{4EDAD5E3-AAAB-48AA-8F7B-2A70ECA14652}\" StaticName=\"Engine\" Name=\"Engine\" DisplayName=\"Engine\" Type=\"TaxonomyFieldTypeMulti\" Group=\"Mygrp\"><TaxonomyGroup ID=\"a8674c62-e812-4e23-88fc-a449958e53ea\">Cars</TaxonomyGroup><TermSet ID=\"d92adc9e-eba7-4734-ac56-ae82483bf1c0\">Engine</TermSet></Field>"
}
2nd Attempt --
{
"verb": "createSiteColumnXml",
"schemaXml": "<Field ID=\"{4EDAD5E3-AAAB-48AA-8F7B-2A70ECA14652}\" ShowField=\"Term1033\" StaticName=\"Engine\" Name=\"Engine\" DisplayName=\"Engine\" Type=\"TaxonomyFieldType\" Group=\"Mygrp\"></Field>"
}
3rd Attempt --
{
"verb": "createSiteColumnXml",
"schemaXml": "<Field ID=\"{4EDAD5E3-AAAB-48AA-8F7B-2A70ECA14652}\" ShowField=\"Engine1033\" StaticName=\"Engine\" Name=\"Engine\" DisplayName=\"Engine\" Type=\"TaxonomyFieldType\" Group=\"Mygrp\"></Field>"
}
Terms are below :
Reference : #2470 on Github
Apr 25 2019 02:37 AM - edited Apr 25 2019 02:42 AM
I managed to add a site column using the script below: -
Connect-PnPOnline "https://{tennancy}.sharepoint.com/sites/{sitename}" -UseWebLogin
Add-PnPTaxonomyField -DisplayName "ArticleType" -InternalName "{fieldname}" -TermSetPath "{termset}|{terms}" -Group "Custom Columns" -MultiValue
Add-pnpfield -field ArticleType -List SitePages