Skip to content

Idempotent issue in Site Scripts with createSPListΒ #4081

@sympmarc

Description

@sympmarc

Category

  • Question
  • Typo
  • Bug
  • Additional article idea

Expected or Desired Behavior

When I create a new list/library in a Site Script and rename it, I should be able to rerun the Site Script at any time and not end up with duplicate lists. The reason I rename it is to start with a clean URL ("FunctionalAreaDocuments") but have a pretty Title ("Functional Area Documents").

Observed Behavior

When I run this snippet in a Site Script a second time, I end up with a second "Functional Area Documents" library. the two libraries have the same Title, but the URLs are:

  • [sitePath]/FunctionalAreaDocuments
  • [sitePath]/FunctionalAreaDocuments1
        {
            "verb": "createSPList",
            "listName": "FunctionalAreaDocuments",
            "templateType": 101,
            "subactions": [
                {
                    "verb": "setTitle",
                    "title": "Functional Area Documents"
                }
            ]
        },

Steps to Reproduce

Run the Site Script snippet above twice - or more. (More times would yield more duplicates.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:site-designCategory: Site Designs/Site Scriptsstatus:to-be-reviewedIssue needs to be reviewed by Microsoft for additional follow up / review.type:archive-old-issueIssues which are closed as tool old for active worktype:questionQuestion... if answered, will be tagged as such.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions