Giter VIP home page Giter VIP logo

sp-dev-site-scripts's Introduction

page_type products languages extensions
sample
office-sp
json
contentType createdDate
samples
12/12/2017 7:56:02 AM

SharePoint Site Script samples

You can use Site Scripts to customize how SharePoint sites are being provisioned. To do this, you construct a JSON object that describes the action to be applied when site is provisioned. You can also start external flow for the additional actions, if needed.

This is a open source repository to share different kind of Site Scripts between community. Check Samples folder for what's currently available. Have you build one which you can share? - We do welcome contributions.

Pic of site design panel in the site

You can find more details around the Site Script and Site Design capability from official SharePoint Dev documentation.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

sp-dev-site-scripts's People

Contributors

ajixumuk avatar bobgerman avatar dependabot[bot] avatar expiscornovus avatar fzoccara avatar hugoabernier avatar microsoftopensource avatar msftgits avatar nilsvbconxion avatar nokafor avatar techchmiel avatar tsekityam avatar vesajuvonen avatar vman avatar ypcode avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sp-dev-site-scripts's Issues

Wait for Flow to complete before showing "Completed" in UI?

Category

  • Question
  • Bug
  • Enhancement

Expected or Desired Behavior

When using the 'TriggerFlow' action, I would expect the UI to wait for the Flow to be completed before telling the user that it's completed and display the "View updated site" button...

Observed Behavior

Right now the 'TriggerFlow' action basically does a "fire and forget" call to the Flow URL. We built an azure provisioning engine based on the following pattern in order to make sure that our logic app waits for everything to be done before completing, but it doesn't change anything since the site design does not wait for the Flow, no matter how long the Flow is running.

To me this doesn't really sens since the UI specifically shows the user that the site design as been applied, it even shows a button saying "View updated site" while we know that the site is most likely not finished provisioning...

I would expect some kind of mechanism which pokes the Flow every X seconds to see if it's completed or something like that, because as it is designed right now, it's kinda confusing for the end user.

Steps to Reproduce

  • Make a site design with a trigger flow action
  • Make sure the Flow runs for 2 minutes
  • Create a site based on the site design and watch the site design complete instantly even though the flow is still running

Trigger Flow(Https) from site Design fails intermediately

@seansquires

Call Flow via Site Script. We have simple Flow which is triggered on HTTP Post and puts site URL to a Azure storage queue for provisioning the site via PnP

Expected or Desired Behavior

Flow should always be executed via Site Design without any error.

Observed Behavior

Intermediately when the site design applied, it says the Flow action failed. I have seen 2 cases.

  1. Even though Site Design panel says Flow failed, in the Flow History it ran successfully and rest all works fine.
  2. Site Design status says Flow failed and that flow not even executed.
    flow

error

MultiChoice Field type doesn't provision properly

Category

  • Question
  • Bug
  • Enhancement

Expected or Desired Behavior

I am trying to deploy a Multi-Choice Site Column with Fill-in choices enabled, add that to a Content Type, create a document library with that content type

Observed Behavior

The Site Column appears to be created, it appears to be added to the content type, but the content type cannot be added to the document library. If I try to manually add the Content Type to the Library then I get a "Sorry, something went wrong. Cannot complete this action. Please try again." error.

If I manually create a MultiChoice Site Column and add it to the Content Type through the UI then it works as expected and I can add the Content Type to the library.

I have also exported the Site Script for a manually created one and used that in my Site Script and it still fails.

Steps to Reproduce

Site Script:

{
    "$schema": "https://developer.microsoft.com/json-schemas/sp/site-design-script-actions.schema.json",
    "actions": [
        {
            "verb": "createSiteColumnXml",
            "schemaXml": "<Field Type=\"MultiChoice\" DisplayName=\"Product\" Group=\"CDMS\" Required=\"FALSE\" EnforceUniqueValues=\"FALSE\" Indexed=\"TRUE\" FillInChoice=\"TRUE\" ID=\"{9a90081c-a89a-4b3c-b041-8f51910a5762}\" StaticName=\"cdmsProduct\" Name=\"cdmsProduct\"><Default>Select...</Default><CHOICES><CHOICE>Select...</CHOICE></CHOICES></Field>"
        },
        {
            "verb": "createContentType",
            "name": "Controlled Document",
            "id": "0x010100E46A99072BB9B747AC570EEBC7D27E25",
            "description": "",
            "parentId": "0x0101",
            "hidden": false,
            "group": "CDMS - Level 1 Content Types",
            "subactions": [
                {
                    "verb": "addSiteColumn",
                    "internalName": "cdmsProduct"
                }
            ]
        },
        {
            "verb": "createSPList",
            "listName": "Administration",
            "templateType": 101,
            "subactions": [
                {
                    "verb": "addContentType",
                    "name": "Controlled Document"
                }
            ]
        }
    ],
    "bindata": { },
    "version": 1
}

Installing Site scripts through Provider hosted apps

I am trying to install site scripts from provider hosted app. I am able to get the installed scripts by /_api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.SiteScriptUtility.GetSiteScripts endpoint. But when I am trying to create scripts it is giving me 401 unauthorized error. i am doing app only calls.
Does App should have access at tenant level to install the scripts?
As of now my PHA is having full control on site collection.

Site Scripts Failing โ€“ CreateSPList and templateType: 106

Category

  • Question
  • [ X] Bug
  • Enhancement

Expected or Desired Behavior

Based on the site script documentation, I would expect to be able to create SharePoint lists of different template types (SPListTemplateType). In trying to add an Events list (templateType: 106), this doesn't appear to be the case.

Observed Behavior

Adding the following verb to a site scripts results in the site script not executing. From the UI, the site design just gets stuck "initiating" and from PowerShell using Invoke-SPOSiteDesign, no output is returned.
{ "verb": "createSPList", "listName": "Events", "templateType": 106, "subactions": [ { "verb": "setDescription", "description": "List of Events" } ] }

Steps to Reproduce

Attempt to execute configure a site script to add a SharePoint list with templateType: 106 (Events list).

Is this not supported and the documentation is simply misleading?

Subaction addFolder

According to schema the subaction addFolder is added. But it doesn't work as expected. Is there any possible update on this issue.

Category

  • Question
  • Bug
  • Enhancement

Expected or Desired Behavior

Add specified Folder(s) under document library.

Thanks for your contribution! Sharing is caring.

Content Types doesn't appear on library after Script Run.

Thank you for reporting an issue or suggesting an enhancement. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you.

Category

  • Question
  • [X ] Bug
  • Enhancement

Expected or Desired Behavior

I create create a Site Script that creates a Site Columns, Content Types , A Doc. Lib. with the Content Type created before.

After run, I Navigate to Document Library Page Settings and the Content Type that are associate to the library don't appear...

I notice that the property "Allow Content Types" is off in library, after switch to on the content type appear in the list of content type associated to the library.

I think this is a bug.

Steps to Reproduce

Create Site Columns , Content Type and a Document Library with the Content Type and after go to Library Settings Page to see if the content type appear in the list os content types of library.

Site script to associate to a document library

Category

  • [X ] Question
  • Bug
  • Enhancement

Expected or Desired Behavior

Invoke Site script on a Library to apply library template to create folders, to add content type updated permissions etc.

Observed Behavior

Looks like this functionality is not available or documentation is missing.

Can someone provide some examples to create a document library and create folders, add content type using SiteScript via CSOM/Powershell

Please provide the option of supplying the actual solution id, instead of internal id for "InstallSolution" verb.

Category

  • Question
  • Bug
  • Enhancement

Expected or Desired Behavior

I should be able to use the actual solution Id from package-solution.json when using the InstallSolution verb.

Observed Behavior

Currently I have to supply an internal Id only available when the solution is installed in an app catalog. This makes it very tedious and error prone to provision sites scripts through code, as I have no way of getting a clear binding between solution id and internal id. ALM API doesn't show the actual id of solution, only the internal id, even though the actual solution id is readily available in the app catalog. Because of this the only way to reference a solution beforehand is to use the ALM API and compare solution name, which is not exactly safe.

Failing subactions within the SharePoint UI

Category

  • Question
  • Bug
  • Enhancement

Observed Behavior

When a subaction fails the History may look like this.
image

The actual substeps have failed but it is not immediately visible where the issue can be found. Especially when the site script is large and many actions have subactions, this can become a needle in the haystack.

In the above example, I had the following failing subaction.

image

It would really help if the error in the subactions was visible at the higher level. Maybe that one should be marked as failed.

Steps to Reproduce

Make a subaction fail and then after application check the site template history.

"InstallSolution" verb is not getting triggered after the site creation

Category

  • Question
  • [#] Bug
  • Enhancement

Expected or Desired Behavior

Added site script with "InstallSolution" as shown below

$site_script=@'
{
"$schema": "schema.json",
"actions": [
{
"verb": "applyTheme",
"themeName": "Default Theme"
},
{
"verb": "installSolution",
"id": "b893e31d-de81-4fbd-8bb6-125e89522456"
}
],
"bindata": { },
"version": 1
}
'@

  • Once the site got created the theme should get apply and the app should be installed.

Observed Behavior

The theme is getting applied and the app is getting installed after the site creation, but if we make a delay of 5 mins or more than that on clicking the Finish Button, then the app installation is not happening but the theme is getting applied.

Steps to Reproduce

  • Create a site script with installSolution verb and add it to the site design

  • Use that site design to create a site

image

  • Click the Finish button after 5 mins or more than that. You will be redirected to the site and the app will not be installed

image

Extend site scripts to launch Azure Functions or Logic apps instead of Flow?

Category

  • Question
  • Bug
  • Enhancement

Site scripts can call a Power Automate flow to customize processes in the background. I saw many customers using this capability to apply governance rules to provisioned SharePoint Online sites.

The recent Power Automate licensing changes move important connectors from standard to premium, making such implementation scenarios costly.

In many situations I saw that Power Automate was just called to perform an HTTP call to some Azure Functions or Logic apps. Therefore, I am wondering if there are some plans to allow site scripts to call such type of resources without calling Power Automate before. This might allow customers implementing governance solutions to keep the current architectures without the need of investing in additional licenses.

Otherwise, I am worried that this type of solution will be used less due to this issue.

Thank you for your feedback,
Patrick

Action failed - Create site column through XML

Category

  • Question
  • Bug
  • Enhancement

Expected or Desired Behavior
Use site script to create the Managed Metadata site columns and add them to default document Library.

Observed Behavior
We are facing issues while site creation, as the first column creation fails sometimes from site script.

This issue is not happening all the times. It is happening randomly

Steps to Reproduce
Use a site script to create Managed Metadata site columns.
Please refer the below blog used to create site columns.
https://www.c-sharpcorner.com/article/creating-managed-metadata-column-using-site-script-and-site-design/

image

Re-run of site script creates new list if internal list name differs to list title

Category

  • Question
  • [ x] Bug
  • Enhancement

Expected or Desired Behavior

As in the docs described: "Once createSPList is applied on a site, runnning the createSPList with the same list name will act as an update to the existing list." https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-json-schema#create-a-new-sharepoint-list

Observed Behavior

The update works not properly if the list has a different title set (setTitle subaction). Instead of an update a new list will be created.

Steps to Reproduce

Add a setTitle subaction to the createSPList action and run the site design at least twice.

How to use 'associateListViewCommandSet'?

Thank you for reporting an issue or suggesting an enhancement. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you.

Category

  • [X ] Question
  • Bug
  • Enhancement

Expected or Desired Behavior

We try to attach a command bar to a newly created list with the 'associateListViewCommandSet' subaction, but all we get is an error that something went wrong.

Could you please give an example on how to use this action and the intended use for it? What's the title used for for example?

Best regards,
Phil

Unable to handle action installSPFXSolution

"Add-SPOSiteScript : Unable to handle action installSPFXSolution. No action handler was registered for this action." error is encountered on Add-SPOSiteScript execution.

Whereas Site Script with verb:applyTheme works perfectly fine.

image

Am I missing any step? What could be the issue?

Thank you for reporting an issue or suggesting an enhancement. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you.

Category

  • Question
  • [ #] Bug
  • Enhancement

Expected or Desired Behavior

If you are reporting a bug, please describe the expected behavior. If you are suggesting an enhancement please describe thoroughly the enhancement, how it can be achieved, and expected benefit.

Observed Behavior

If you are reporting a bug, please describe the behavior you expected to occur when performing the action. If you are making a suggestion, you can delete this section.

Steps to Reproduce

If you are reporting a bug please describe the steps to reproduce the bug in sufficient detail to allow testing. Only way to fix things properly, is to have sufficient details to reproduce it. If you are making a suggestion, you can delete this section.

Submission Guidelines

Delete this section after reading

  • All suggestions or bugs are welcome, please let us know what's on your mind.
  • If you are reporting an issue around any of the samples, please ensure that you have clear reference on the sample and possibly code file, which should be fixed.
  • Remember to include sufficient details and context.
  • If you have multiple suggestions or bugs please submit them in separate bugs so we can track resolution.

Thanks for your contribution! Sharing is caring.

Site columns added to a library are automatically added to list content type

Category

  • Question
  • [x ] Bug
  • Enhancement

Expected or Desired Behavior

When I add content types via addContentType subaction to a library I only want to get those site columns assigned to the content type that are defined in the createContentType action.

Observed Behavior

But unfortunately when I have a look at my library, all site columns, that I've added to the library where assigned to the content type automatically. Thats really annoying as I use some hidden site columns for data handling that shouldn't be visible to the end-user.

Steps to Reproduce

Define a content type with the createContentType action. Add it to a library via addContentType subaction. After that use the addSiteColumn subaction to add some more site columns, that are not a part of the content type previously defined.
Invoke the script and have a look at the libraries settings > columns section. As you can see, all columns are now part of the content type even if they were not defined to be so.

When using /_api/Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteScriptUtility.GetSiteScriptFromWeb Document libraries exports are invalid

Category

  • Question
  • Bug
  • Enhancement

Expected or Desired Behavior

The /_api/Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteScriptUtility.GetSiteScriptFromWeb endopoint should generate a valid site script that can be used during the import

Observed Behavior

When the following is included in the body of the call to the end point

   "IncludedLists":[ 
         "Shared Documents"
      ],

I'm getting the following included in my exported script

{
            "listName": "Documents",
            "subactions": [
                {
                    "verb": "addSPFieldXml"
                },
                {
                    "verb": "addSPFieldXml"
                },
                {
                    "verb": "addSPFieldXml"
                },
                {
                    "verb": "addSPFieldXml"
                },
                {
                    "verb": "addSPFieldXml"
                },
                {
                    "verb": "addSPFieldXml"
                },
                {
                    "verb": "addSPFieldXml"
                },
                {
                    "verb": "addContentType"
                },
                {
                    "verb": "addContentType"
                },
                {
                    "verb": "addContentType"
                },
                {
                    "verb": "addContentType"
                },
                {
                    "verb": "addContentType"
                },
                {
                    "verb": "addSPView"
                },
                {
                    "verb": "addSPView"
                }
            ],
            "templateType": 101,
            "verb": "createSPList"
        },

The verbs seem to be included but the details are not.

Steps to Reproduce

Call the endpoint mentioned above and include a document library. In my case I'm calling the endpoint from a flow, however that should be irrelevant.

DisplayName not "regionalized" when using addSPField verb

Thank you for reporting an issue or suggesting an enhancement. We appreciate your feedback - to help the team to understand your needs, please complete the below template to ensure we have the necessary details to assist you.

Category

  • Question
  • Bug
  • Enhancement

Expected or Desired Behavior

Adding a list with fields using site script verbs createSPList and addSPField and PowerShell on an existing site with non-english regional settings (LCID 1030 in this case).
When site is created, the displayName of the fields should behave just like an addSPFieldXml: the displayName should be added to all languages.

Observed Behavior

The displayName field only seems to be visible for en-US language. The other languages (eg if you have a browser with danish regional settings) show internalName.
I confirmed this by exporting translations XML for the sites: the "value" XML element contains the displayName only in the .en-US.resx file. In all other .resx files fields created with addSPField are showing internalName, but fields created with addSPFieldXml shows correct DisplayName value from Field xml value.

Steps to Reproduce

If you are reporting a bug please describe the steps to reproduce the bug in sufficient detail to allow testing. Only way to fix things properly, is to have sufficient details to reproduce it. If you are making a suggestion, you can delete this section.

Submission Guidelines

  • Create a JSON file with createSPList verb for a custom list
  • Add sub actions with at least 1 addSPField and 1 addSPFieldXml

Use PowerShell to add a site design with the above site script
Use PowerShell to invoke the site design on a non-english site collection for example Danish/1030 (not sure this step is necessary)
Observe field names are internal for non-english browsers, or simply export translations for English and Danish and observe the different behaviour: fields created with addSPField use displayName only in English resx, other languages use internalName, but for addSPFieldXml they are shown correctly for all languages.

Example JSON (subset):

...
{
          "displayName": "Ekstern support",
          "internalName": "Doksys_Eksternsupport",
          "isRequired": false,
          "addToDefaultView": true,
          "fieldType": "Note",
          "enforceUnique": false,
          "verb": "addSPField"
        },
        {
          "verb": "addSPFieldXml",
          "schemaXml": "<Field Type=\"URL\" DisplayName=\"Driftsvejledning\" Required=\"FALSE\" EnforceUniqueValues=\"FALSE\" Format=\"Hyperlink\" StaticName=\"Doksys_Driftvejledning_link\" Name=\"Doksys_Driftvejledning_link\" />"
        }
...

Example from en-US.resx with both correct value for "Ekstern support" and "Driftvejledning":
<data name="4cd084bb64214a9e9f2c3ee933b7512e_FieldTitleDoksys_Driftvejledning_link"><value>Driftsvejledning</value><comment>Single line of text</comment></data><data name="4cd084bb64214a9e9f2c3ee933b7512e_FieldTitleDoksys_Eksternsupport"><value>Ekstern support</value><comment>Single line of text</comment></data>

Example from da-DK.resx with incorrect value for "Ekstern support" but correct for "Driftvejledning":
<data name="4cd084bb64214a9e9f2c3ee933b7512e_FieldTitleDoksys_Driftvejledning_link"><value>Driftvejledning</value><comment>Single line of text</comment></data><data name="4cd084bb64214a9e9f2c3ee933b7512e_FieldTitleDoksys_Eksternsupport"><value>Doksys_Eksternsupport</value><comment>Single line of text</comment></data>

setSiteExternalSharingCapability doesn't work

Category

  • Question
  • [ x] Bug
  • Enhancement

Expected or Desired Behavior

External Sharing for the newly provisioned group should get disabled

Observed Behavior

Not working as expected.

Steps to Reproduce

Applied this { "verb": "setSiteExternalSharingCapability", "capability": "Disabled"} as part of the site script but Get-SPOSITE command suggests that it didn't work (see screenshot)

.image

Thanks for your contribution! Sharing is caring.

Display name is not set correctly with site script action - createSiteColumnXml

Category

  • Question
  • [x ] Bug
  • Enhancement

Expected or Desired Behavior

I wanna create a site column with site script and site design through "createSiteColumnXml" and the column should created with all properties set in the xml.

Observed Behavior

When I create a new site or update an existing one by applying the site design, the column would be created but the display name is not set correctly. The DisplayName property is ignored.

DisplayName in site script: Short Description
DisplayName after column creation: ShortDescription

Steps to Reproduce

If you are reporting a bug please describe the steps to reproduce the bug in sufficient detail to allow testing. Only way to fix things properly, is to have sufficient details to reproduce it. If you are making a suggestion, you can delete this section.

Submission Guidelines

Site script actions
{ "verb": "createSiteColumnXml", "schemaXml": "<Field Type=\"Note\" DisplayName=\"Short Description\" Required=\"TRUE\" EnforceUniqueValues=\"FALSE\" Indexed=\"FALSE\" NumLines=\"6\" RichText=\"TRUE\" RichTextMode=\"FullHtml\" IsolateStyles=\"TRUE\" Sortable=\"FALSE\" Group=\"ACP PFM\" ID=\"{90b23616-512b-4f3c-8a89-e68430ea76d2}\" StaticName=\"ShortDescription\" Name=\"ShortDescription\" CustomFormatter=\"\" RestrictedMode=\"TRUE\" AppendOnly=\"FALSE\" UnlimitedLengthInDocumentLibrary=\"FALSE\" Customization=\"\" AllowDeletion=\"TRUE\" />", "pushChanges": true

removeContentType on Folder, does not work.

Category

  • Question
  • Bug
  • Enhancement

Expected or Desired Behavior

Should remove the content type from the menu and document library.

Using a Teams site as the base template.

Observed Behaviour

Content type has been removed from the document library, but the 'Folder' button is still showing in the document library menu.

image

Screenshot to show the content type is not in this site

image

Steps to Reproduce

Created a site script with the following included
{
"verb": "removeContentType",
"name": "Folder"
},

Template history shows the content type is being removed successfully

image

"creatorEmail " field in power automate called from site script gives wrong data.

Category

  • Bug

Expected or Desired Behavior

In Site inventory created from below mentioned tutorial should have creator name while the site members group name started appearing in place of owner.

image

URL: https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-trigger-flow-tutorial

Observed Behavior

creatorEmail should have owner email in place of office365 members group name.

Steps to Reproduce

Please follow the tutorial and call Power Automate from a site script.Used Schema

{ "type": "object", "properties": { "webUrl": { "type": "string" }, "parameters": { "type": "object", "properties": { "event": { "type": "string" }, "product": { "type": "string" } } }, "webDescription": { "type": "string" }, "creatorName": { "type": "string" }, "creatorEmail": { "type": "string" }, "createdTimeUTC": { "type": "string" } } }

URL: https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-trigger-flow-tutorial

Option for adding the column into all the content types is missing

Category

  • Question
  • Bug
  • Enhancement

Expected or Desired Behavior

While adding a column to a list, we should get an option for adding it into all the content types.

"verb": "createSPList",
"listName": "Site Pages",
"templateType": 119,
"subactions": [
{
"verb": "addSPField",
"fieldType": "Text",
"displayName": "Customer Name",
"isRequired": false,
"addToDefaultView": true,
"addToAllContentTypes":true (This option is missing)
}
]

Observed Behavior

While adding a site column or list column to the list/library manually, there are two options available "Add to all content types" and "Add to default view"

image

But while doing the same thing using the site script the "Add to all content types" option is missing.

Steps to Reproduce

Attach the below site script to a site design and create a site with that template. The result will be under the Site Pages library of the newly created site.

$teamScript=@'
{
"$schema": "schema.json",
"actions": [
{
"verb": "createSPList",
"listName": "Site Pages",
"templateType": 119,
"subactions": [
{
"verb": "addSPField",
"fieldType": "Text",
"displayName": "Customer Name",
"isRequired": false,
"addToDefaultView": true,
"addToAllContentTypes":true
}
]
}

],
"bindata": { },
"version": 2
}
'@

The IsDefault switch on Add-SPOSiteDesign does not work

Category

  • Question
  • Bug
  • Enhancement

Expected or Desired Behavior

As documented here, it should be possible to add site scripts to a default site design (team site/communication site) by providing the IsDefault switch to the Add-SPOSiteDesign command.

Observed Behavior

No matter how I try to use the Add-SPOSiteDesign command with the IsDefault switch, a new site design always appears in the UI instead of being applied to the default site design. When clicking on the +Create site button in the UI and then on the Team Site tile, I get a dropdown asking me to choose a design between Team Site and whatever the design I just created

Steps to Reproduce

  • Make sure you have a site script in a $script variable
  • Run the following command
    Add-SPOSiteDesign -Title "Default" -Description "Default" -WebTemplate "64" -SiteScripts $script -IsDefault
  • Go in the UI and see that the Team Site definition has not changed, a new one has been created instead.

My SharePoint Online Management Shell is currently at version 16.0.7813.1200 (although the PowerShell module does display 16.0.7813.0)

setRegionalSettings - Action Failed

Category

  • Question
  • [X ] Bug
  • Enhancement

Expected or Desired Behavior

Using SiteScripts and verb "setRegionalSettings" user should be able to set newly created site Regional Settings.
{
"verb": "setRegionalSettings",
"timeZone": 6, /* UTC + 1 /
"locale": 1060, /
Slovenian /
"sortOrder": 34, /
Slovenian */
"hourFormat": "24"
},

Observed Behavior

When creating new site using SiteTemplate I get "Action Failed" for Regional Settings and sites Regional Settings are not set correctly. I tried some other settings (for Croatian which is avaialable in https://github.com/SharePoint/sp-dev-site-scripts/tree/master/samples/site-apply-regional-settings) and it worked OK).

Steps to Reproduce

Create SiteTemplate by steps provided by Microsoft and try to set regionalSettings.

"joinHubSite" and assign to HubSite generates infinite loop

Category

  • Question
  • Bug
  • Enhancement

Expected or Desired Behavior

Would it be great that when HubSite is starting the site script containing the verb "joinHubSite", it just ignores the verb, because it is already joined a HubSite?

Observed Behavior

When a site design containing a script with "joinHubSite" verb is connected to HubSite it generates an infinite loop.

Steps to Reproduce

Powershell:
Set-SPOHubSite https://yourtenant.sharepoint.com/sites/hubsite -Title "HubSite" -SiteDesignId "xxx"

JSON:
"verb": "joinHubSite", "hubSiteId": "yyy", "name": "HubSite"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.