Forum Discussion

Gary_Stewart's avatar
Gary_Stewart
Copper Contributor
May 29, 2019

Site 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 Replies

  • Gary_Stewart 

     

    Laura Kokkarinen talks about this in her blog post on Site Designs and Site Scripts. Are you on a first release tenant?

     

    https://laurakokkarinen.com/the-ultimate-guide-to-sharepoint-site-designs-and-site-scripts/#large-site-designs

    • Dinesh Bhat's avatar
      Dinesh Bhat
      Copper Contributor

      Thomas Berman @Laura Kokkarinen @Gary_Stewart 

       

      We have large site with more than 30 list and library. So we have split into 4 site scripts due to limit of 100000 characters. After we have added 4 site scripts into site using below code

      Add-SPOSiteDesign `
      -Title "My customer tracking" `
      -WebTemplate "64" `
      -SiteScripts script1.id,script2.id,script3.id,script4.id `
      -Description "Tracks key customer data in a list" `
      -PreviewImageUrl "https://contoso.sharepoint.com/SiteAssets/site-preview.png" `
      -PreviewImageAltText "site preview"

       

      After when we try to apply Add-SPOSiteDesignTask throwing below error 

       

      "Operation is not valid due to the current state of the object"  any idea? how to resolve or root cause

       

      Thanks

       

Resources