SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.25k stars 1.02k forks source link

createSPList not updating the existing list #10003

Open ahmad-uzair opened 2 weeks ago

ahmad-uzair commented 2 weeks ago

Target SharePoint environment

SharePoint Online

What SharePoint development model, framework, SDK or API is this about?

Site designs & site scripts

Developer environment

macOS

What browser(s) / client(s) have you tested

Additional environment details

Power Automate Flow SharePoint HTTP Connector

Describe the bug / error

When i run a createSPList site script on an existing list, it gives the follwoing error:

{ "ErrorCode": -2130575342, "Outcome": "2", "OutcomeText": "List with name already exists.", "Target": null, "TargetId": null, "Title": "Create or update list ", "Verb": "createSPList" }

Steps to reproduce

  1. Create a new Sharepoint List in another tenant from an existing list in one tenant using the createSPList site script
  2. Add a new column to the sharepoint in the source tenant
  3. Run the createSPList site script again

Expected behavior

It should update the existing list as mentioned in the note on the documentation here

https://learn.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-json-schema#create-a-new-sharepoint-list