Forum Discussion
How to Provision Site Columns and Content Types using Provisioning Template by Patterns and Practice
- 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>
ried with root web but still not getting sitefields(site column),content type
Do you mean that you created the fields at the subsite level? That isn't supported and not perticularly following best practise.
In short if you created a field Text in subsite 1 and a field Text in subsite 2 then depending on which site was created first the internal names used would become Text and Text1.
You might then find that code will fail as unexpected internal names are used. It would be better to create these fields at the top level and reuse the fields across subsite.
- DeletedAug 16, 2018
Then it would be a column in the list itself
- DeletedMay 19, 2017
Pieter is right. on that one. only rootweb is supported you can do a subsite but it will not retract sitefields and contenttypes!
- Myasnikov AndreyAug 15, 2018Copper Contributor
What if I have subsite site field (lookup). This site field cannot be created on the root web because the list from where it takes data from is on the subsite.
If I get everything right, this is the real normal case that the tool doesn't support.
So I cannot use the tool to generate xml and apply it.