Tuesday, April 23, 2019

List of actions behavior when updating SharePoint sites with Site Designs

For the last two months I've used Site Designs to update different kinds of existing SharePoint site collections. To be honest, I was very impressed about the good update results. For instance, quickly updating installed apps via Invoke-SPOSiteDesign. In this blog post, I want to share with you a detailed documentation I created about the actions (Site Script verbs) behavior during applying Site Designs to a SharePoint site collection which has already run older Site Design versions.

The table below, shows a list of top level actions:
Action (Verb) Support update Notes
activateSPFeature Yes Adds specified web feature if not yet added. Doesn’t add site features yet! Maybe it will be supported in the future
createSiteColumn Yes Following properties are supported: displayName, group and enforceUnique
createContentType Yes Following properties are supported: description, hidden and subactions
addNavLink No Yes Updating url or displayName is not possible with it. The trick here is to first remove the existing node using removeNavLink and then to re-add it with addNavLink within the same script. Other properties such as parentDisplayName should be supported 
applyTheme Yes Overrides the existing theme
setSiteLogo Yes This action is only supported in Communication Sites. It overrides the existing site logo
joinHubSite Yes If site is already associated to a Hub Site, the current site will be associated to a new Hub Site. If the Hub Site was set up with a Site Design, this Site Design will also be applied
installSolution Yes If site has an older add-in version, applying a new version will update the installed add-in
associateExtension Yes If site has an older extension version, applying a new version will update the installed extension
triggerFlow No You can't update an already triggered Flow instance. Just trigger a new flow instance
setRegionalSettings Yes Overrides existing regional settings. Following properties are supported: timeZone, locale, sortOrder and hourFormat
addPrincipalToSPGroup No Neither removes nor re-adds existing users. Just adds new users to security groups.
setSiteExternalSharingCapability Yes Overrides the existing sharing capability

The table below, shows a list of sub actions to run on the list:
Action (Verb) Support update Notes
setTitle Yes Overrides existing title
setDescription Yes Overrides existing description
addSPField Yes Following properties are supported: displayName and addToDefaultView (only from false to true)
deleteSPField Yes Removes specified field if not yet removed. Even if field has data!
addSPFieldXml Yes Following properties are supported: schemaXml (type, displayName, required, defaultValue etc. Seems to update everything) and addToDefaultView (only from false to true)
addSPLookupFieldXml Yes Following properties are supported: schemaXml (displayName, showField, required etc. Seems to update everything, but I didn’t test other properties) and addToDefaultView (only from false to true)
addSiteColumn Yes Associates site column with default content type only. Updates addToDefaultView property (only from false to true)
addSPView Yes Following properties are supported: query, rowLimit, isPaged, makeDefault, scope and viewFields (add new fields, but doesn’t remove existing ones)
removeSPView Yes Removes specified view if not yet removed. Won’t remove default views
addContentType Yes Adds specified content type if not yet added
removeContentType Yes Removes specified content type if not yet removed. Won’t remove a content type if it is being used
setSPFieldCustomFormatter Yes Following properties are supported: formatterJSON and fieldDisplayName (applies custom formatter to another column)
associateFieldCustomizer Yes Following properties are supported: clientSideComponentProperties and internalName (applies customization to another field)
associateListViewCommandSet Yes I didn’t get this action to work. Test ended up with the following error:
"Associate command set HelloWorld Something went wrong and we could not complete this action."

How did I run my Site Scripts?

I used PowerShell and the SharePoint user interface to apply my Site Design. Running Site Designs through PowerShell is always a fantastic experience. Invoke-SPOSiteDesign returns a quick response even when running a Site Script with many actions. On the other hand, working with Site Designs through the SharePoint user interface was a slow, but very fancy experience.

Summary

Site Designs is a new capability for provisioning in Office 365. If you haven't tried out it yet, then go ahead and give it a try. It supports updating existing SharePoint content in a very stable manner. Did you find a test result different than mine? Then post it as a comment and let us improve these lists together.

No comments:

Post a Comment