Forum Discussion
omkar kuchekar
May 19, 2017Copper Contributor
How to Provision Site Columns and Content Types using Provisioning Template by Patterns and Practice
Hi All, I would like to add site columns and content type using PnP provisioning schema xml template. I need XML format for this like sitefields. I am using below xml but it doesnt creating any s...
- May 19, 2017Yes got the solution. adding existing site column to list as below.
<pnp:FieldRefs>
<pnp:FieldRef ID="baf7091c-01fb-4831-a975-08254f87f234" Name="Non-Working Day" DisplayName="Non-Working Day"></pnp:FieldRef>
</pnp:FieldRefs>
Anonymous
May 19, 2017how does the rest of your xml look?
<Field Type="Text" DisplayName="Document Number" Required="FALSE" EnforceUniqueValues="FALSE" Indexed="FALSE" MaxLength="255" Group="VO Project" ID="{c2a7fdd0-7a55-40ec-85fc-e5e4de4171d4}" SourceID="{910f1ba0-847d-4238-8de0-fc0cb19047c4}" StaticName="DocumentNumber" Name="DocumentNumber">
</Field>
this is a example of a sitefield
omkar kuchekar
May 19, 2017Copper Contributor
Yes its correct. but i need to add column to list from existing site columns using PnP provisioning schema.With above xml we can add new column to list.Let me corrrect if i am wrong.
- omkar kuchekarMay 19, 2017Copper ContributorYes got the solution. adding existing site column to list as below.
<pnp:FieldRefs>
<pnp:FieldRef ID="baf7091c-01fb-4831-a975-08254f87f234" Name="Non-Working Day" DisplayName="Non-Working Day"></pnp:FieldRef>
</pnp:FieldRefs>- omkar kuchekarMay 19, 2017Copper ContributorFor adding existing content type
<pnp:ContentTypeBindings>
<pnp:ContentTypeBinding ContentTypeID="0x0101" />
</pnp:ContentTypeBindings>- May 19, 2017
The easiest way to do this is to simply export an existing site after you created the fields and content types manually.
Also, if you use Visual Studio you can enable Intellisense. Follow these steps:
https://veenstra.me.uk/2015/12/10/office-365sharepoint-2013-enable-intellisense-of-officedevpnp/