May 18 2017 10:31 PM
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 site column and not giving any error too.
May 18 2017 11:22 PM
how does the rest of your xml look?
May 18 2017 11:56 PM
May 19 2017 12:05 AM
SolutionMay 19 2017 12:08 AM
May 19 2017 01:01 AM
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/
May 19 2017 01:40 AM
May 19 2017 01:51 AM
You will need to export the root web of the site collection to get all your site fields. Subwebs do not export site fields or site content types.
May 19 2017 02:40 AM
ried with root web but still not getting sitefields(site column),content type
May 19 2017 02:46 AM - edited May 19 2017 03:02 AM
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.
May 19 2017 03:02 AM
Pieter is right. on that one. only rootweb is supported you can do a subsite but it will not retract sitefields and contenttypes!
Aug 15 2018 04:40 AM
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.
Aug 15 2018 10:52 PM
Then it would be a column in the list itself
May 19 2017 12:05 AM
Solution