Site Designs
5 TopicsSite Script - Adding column to Site Pages is not inherited by Repost Page content type
Hi, Adding a column to the Site Pages library using the UI has the option "Add to all content types" which seems to be missing in Site Script. So, adding a site column via Site Script as below results that columns is only inherited by the Site Page content type and not the Repost Page. "actions": [ { "verb": "createSPList", "listName": "Site Pages", "templateType": 119, "subactions": [ { "verb": "addSiteColumn", "internalName": "PageCategory", "addToDefaultView": true } ... } Results in: This could be solved by modifying the base site content type: "actions": [ { "verb": "createContentType", "name": "Site Page", "description": "Create a new site page", "hidden": false, "parentName": "Document", "subactions": [ { "verb": "addSiteColumn", "internalName": "PageCategory" } ] }, { "verb": "createContentType", "name": "Repost Page", "description": "Used to create a News link post. If deleted, the News link option will be disabled for users.", "hidden": false, "parentName": "Site Page", "subactions": [ { "verb": "addSiteColumn", "internalName": "PageCategory" } ] }, { "verb": "createSPList", "listName": "Site Pages", "templateType": 119, "subactions": [ { "verb": "addContentType", "name": "Site Page" }, { "verb": "addContentType", "name": "Repost Page" } ... } So, to my questions: Is the approach with modifying the base site content type "OK" nowdays or is it violating any practices/rules? Reflections on this? If 1 is not OK then is it solvable using Site Design/Site Script or will it require alternative approach such as PnP? NOTE: Want to use Site Design/Site Script and would like to avoid creating own content type in this case. /Adam1.2KViews0likes0CommentsSite Script Action Limit
Microsoft's documentation states: We'd previously capped the limit of site script actions to 30. This remains the limit for scripts applied synchronously using the https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/Invoke-SPOSiteDesign?view=sharepoint-ps command, but based on customer feedback and support for additional actions we have bumped this limit to 300 actions (or 100,000 characters) when the scripts are applied asynchronously (either through the UI or using the https://docs.microsoft.com/en-us/powershell/module/sharepoint-online/Add-SPOSiteDesignTask?view=sharepoint-ps command). I created a script that has more than 30 actions, and indeed the Invoke-SPOSiteDesign command does not work; however, the Add-SPOSiteDesignTask does work. I assume that ..."through the UI" in the statement above refers to creating a site using the Create Site button in SharePoint. When I use the Create Site button with my design that contains the +30 action script. It does not work. I just get the message that it is Initializing, but nothing ever happens. If I cancel out of the operation and then use the PowerShell Add-SPOSiteDesignTask command, the design is applied as expected. What does Microsoft mean by "...through the UI"?2.6KViews0likes2CommentsAzure Automation Runbooks using Powershell: Push notifications error?
I'm trying to run some PnP PowerShell commands in an Azure Runbook (e.g. Get-PnPContentType, Apply-PnPProvisioningTemplate, etc. ) over a SharePoint site, but it keeps returning the error below: The Push Notifications feature is not activated on the site The correct modules have been imported and it only errors on some commands. Running the commands in a PowerShell window with the same credentials doesn't produce any errors, and activating the 'Push Notifications' feature manually and retriggering the Runbook won't produce any error output, but will say that the Runbook failed to run 3 times.4.2KViews0likes1CommentAdd new SPWeb with Sitescript?
Hey there Is there a way to add a new SPWeb (Subsite) via PnPPowerShell (or any other way?) with a site script? I am aware of applying a site script AFTER the creation, but this will cause some unnecessary ootb libraries/notebooks/etc. to be created, rather than just what I need (-> whats in the sitescript).Solved1.4KViews0likes2CommentsSite design and Taxonomy fields
I'm creating a site design with custom taxonomy fields, content type with these fields and a list that uses my content type. When applying the site design to a site the site columns and the content type work but adding my content type to the list results in an error "Action failed". If I remove the taxonomy fields from the content type it is applied to the list successfully. Is this supported? Is there any way I can get a more detailed error? My site script: { "$schema": "schema.json", "actions": [ { "verb": "setRegionalSettings", "timeZone": 2, "locale": 1033, "sortOrder": 11 }, { "verb": "createSiteColumnXml", "schemaXml": "<Field Type=\"Note\" DisplayName=\"Taxonomy Test_0\" StaticName=\"xx\" Name=\"xx\" ID=\"{22222222-2222-2222-2222-222222222222}\" ShowInViewForms=\"FALSE\" Required=\"FALSE\" Hidden=\"TRUE\" CanToggleHidden=\"TRUE\" />" }, { "verb": "createSiteColumnXml", "schemaXml": "<Field Type=\"TaxonomyFieldType\" DisplayName=\"Taxonomy Test\" ShowField=\"Term1033\" Required=\"FALSE\" EnforceUniqueValues=\"FALSE\" Group=\"Test\" ID=\"{33333333-3333-3333-333333333333}\" SourceID=\"{{siteid}}\" StaticName=\"TaxonomyTest\" Name=\"TaxonomyTest\" List=\"{{listid:TaxonomyHiddenList}}\" AllowDeletion=\"TRUE\"><Default></Default><Customization><ArrayOfProperty><Property><Name>SspId</Name> <Value xmlns:q1=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q1:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">{zzzzzzzz-zzzz-zzzz-zzzzzzzzzzzz}</Value> </Property><Property> <Name>GroupId</Name> <Value xmlns:q2=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q2:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxx</Value> </Property><Property><Name>TermSetId</Name><Value xmlns:q2=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q2:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">yyyyyyyy-yyyy-yyyy-yyyyyyyyyyyy</Value> </Property><Property><Name>AnchorId</Name><Value xmlns:q3=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q3:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">00000000-0000-0000-0000-000000000000</Value> </Property><Property><Name>UserCreated</Name><Value xmlns:q4=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q4:boolean\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">false</Value></Property> <Property><Name>Open</Name><Value xmlns:q5=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q5:boolean\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">false</Value></Property><Property><Name>TextField </Name><Value xmlns:q6=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q6:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\"> {22222222-2222-2222-2222-2222222222}</Value></Property><Property><Name>IsPathRendered</Name> <Value xmlns:q7=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q7:boolean\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\"> false</Value></Property><Property><Name>IsKeyword</Name><Value xmlns:q8=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q8:boolean\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">false</Value></Property> <Property><Name>TargetTemplate</Name></Property><Property><Name>CreateValuesInEditForm</Name> <Value xmlns:q9=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q9:boolean\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\"> false</Value></Property><Property><Name>FilterAssemblyStrongName</Name><Value xmlns:q10=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q10:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">Microsoft.SharePoint.Taxonomy, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Value></Property><Property><Name>FilterClassName</Name> <Value xmlns:q11=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q11:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">Microsoft.SharePoint.Taxonomy.TaxonomyField</Value> </Property><Property><Name>FilterMethodName</Name><Value xmlns:q12=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q12:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">GetFilteringHtml</Value></Property> <Property><Name>FilterJavascriptProperty</Name><Value xmlns:q13=\"http://www.w3.org/2001/XMLSchema\" p4:type=\"q13:string\" xmlns:p4=\"http://www.w3.org/2001/XMLSchema-instance\">FilteringJavascript</Value> </Property></ArrayOfProperty></Customization></Field>" }, { "verb": "createContentType", "name": "TestContentType", "id": "0x01000xxx", "hidden": false, "subactions": [ { "verb": "addSiteColumn", "internalName": "xx" }, { "verb": "addSiteColumn", "internalName": "TaxonomyTest" } ] }, { "verb": "createSPList", "listName": "TestList", "templateType": 100, "subactions": [ { "verb": "setTitle", "title": "Test List" }, { "verb": "addContentType", "name": "TestContentType" } ] } ], "bindata": {}, "version": 1 }Solved2.3KViews0likes1Comment