Sep 28 2020 01:48 AM
Hi,
I've been trying to use the Rest API to create Content Types without luck (as it seems there's a bug which Microsoft is not willing to fix): https://github.com/pnp/pnpjs/issues/457
Also, there's no documented way to do the same through the Graph API.
So, do you guys know any way to create Content Types massively or import them in a similar way it's done through the new Term Store?
Thanks!
Sep 28 2020 03:04 AM
@andres101 Try creating content types with PowerShell,
Add-PnPContentType -Name "<name> " -Description "<description>" -Group "<group name>" -ParentContentType <parent content type (to fetch default columns)>
Then you can add fields to that specific content type:
Add-PnPField -DisplayName "<display name>" -InternalName "<internal name>" -Type <field type> -Group "<same group as the content type>"
Sep 28 2020 04:21 AM - edited Sep 28 2020 04:52 AM
Hey! Thanks for your response.
Could you provide be with a link to the powershell documentation related to this? My background is Web Development and I have no experience with Microsoft PowerShell.
Also, note that it should be able to work with SharePoint Onlilne
Sep 28 2020 08:56 AM
Solution@andres101 This works well with SharePoint Online! :) Could you please mark my previous post as best answer if it was what you were looking for?
Here is the link:
https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/add-pnpcontenttype?view=sharepoint...
If you need any more assistance, please notify me.
Oct 13 2020 02:00 AM
Sep 28 2020 08:56 AM
Solution@andres101 This works well with SharePoint Online! :) Could you please mark my previous post as best answer if it was what you were looking for?
Here is the link:
https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/add-pnpcontenttype?view=sharepoint...
If you need any more assistance, please notify me.