Let's POWER Automate

From no-code to low-code

Menu
  • Expressions
  • Filters
  • General
  • Application specific solutions
    • Dataverse
    • Excel
    • Forms
    • Outlook
    • Planner
    • Power Apps
    • SharePoint
    • Teams
  • Triggers
  • Ready to use solutions
    • Approval Process Template
    • Task Delegation App
    • The Ultimate Power Automate expressions cheat sheet
    • Power Automate HTTP requests to SharePoint cheat sheet
    • Power Automate HTTP requests to Graph API cheat sheet
  • ABOUT ME
  • Get help with your flow
  • POWER PLATFORM SERVICES
Menu

Create new SharePoint list from existing SP list with Power Automate

Posted on May 19, 2021February 21, 2025 by Tom

“I need to create the same SharePoint list with multiple columns on various SP sites, can Power Automate use SP list as a template? Or do I need build it from scratch column after column?”


If you use Power Automate to create SharePoint list(s), you probably use multiple HTTP requests. One HTTP request to create the list, and then separate HTTP requests for each column in the list, as described for example in this blog post. But I believe there’s an easier way utilising the OOTB SharePoint functionality to create a new list from an existing one.

When you create a ‘template’ SP list, you don’t need to bother with any code. You can use the SharePoint interface to define all the columns, their type and format, list views… and then you manually create new list from the ‘template’…

…or you can use Power Automate to do it for you. If you open the console in your browser during the manual process, you can track what’s happening. Among all the requests are 2 API calls responsible for the list creation.

_api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.SiteScriptUtility.GetSiteScriptFromList()

_api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.SiteScriptUtility.ExecuteTemplateScript()

The first request will get all the information about the source list. The second one will use it to create a new list. If you replicate these two calls from your flow, you can create a new SP list from an existing one.

GetSiteScriptFromList()

As already mentioned, the first HTTP request will get the SharePoint list structure. Here it doesn’t matter what ‘Site Address’ you use as long as it’s in your environment (but the listUrl matters!).

Method: POST

Uri: _api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.SiteScriptUtility.GetSiteScriptFromList()

Headers:
{
  "accept": "application/json;odata=verbose",
  "content-type": "application/json;odata=verbose"
}

Body:
{
  "listUrl": "https://<xxx>.sharepoint.com/sites/<SourceSiteName>/Lists/<SourceListName>/"
}

Note: everything inside < .. > is a placeholder, you should replace it including the < and >.

Power Automate get SharePoint list schema

The output of this HTTP request will be a hard-to-read JSON schema of the source list, and potentially also source for the ‘lookup’ lists.

SharePoint list schema

Parse the output

Now you’ve got the JSON and it’s time to prepare it for the second HTTP request with the ‘Parse JSON’ action. To save a few actions, you can access directly the ‘GetSiteScriptFromList’ value in the JSON. That’s where all the list information is stored.

outputs('<HTTPrequestActionName>')?['body']?['d']?['GetSiteScriptFromList']

e.g.
outputs('Send_an_HTTP_request_to_SharePoint_-_get_list_structure')?['body']?['d']?['GetSiteScriptFromList']

Use the whole output from the previous HTTP request as the sample payload for ‘Parse JSON’.

Power Automate parse SharePoint list schema

The output from such ‘Parse JSON’ will be the same JSON, this time in a more readable format, but still far away from the required format for the second request.

ExecuteTemplateScript()

For the second HTTP request body you must enclose only the “actions” object from the JSON above in a ‘{“script”:’ element.

{"script": "{\"actions\": [....] }" }

Unfortunately, the output has one extra element “$schema”. You’re not interested in that one, you need only the “actions”, the “$schema” must be removed. That’s why you need the ‘Parse JSON’, to allow you to select only the “actions”.

body('Parse_JSON')?['actions']

And with that it’s time to build the whole request body. You’ve got the value from “actions”, now you must add back the “actions” element and enclose it in a “script”. You must also turn this nice request into the less-readable original form by replacing \ with \\ and ” with \”.

This time also the ‘Site Address’ matters, it’s the target site for the new list.

NOTE: it seems that the schema was updated by Microsoft and now it needs also value in the addNavLink property otherwise the request will fail. Change the value in the Body expression below from true to false if you don’t want the list added to the navigation.

Method: POST

Uri: _api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.SiteScriptUtility.ExecuteTemplateScript()

Headers:
{
  "accept": "application/json;odata=verbose",
  "content-type": "application/json;odata=verbose"
}

Body:
{"script": "{\"actions\":[@{replace(replace(string(setProperty(body('Parse_JSON')?['actions'][0],'addNavLink',true)),'\','\\'),'"','\"')}]}"}

I’d also recommend to renaming the list during creation as it seems to be created with a strange name now.

Body:
{"script": "{\"actions\":[@{replace(replace(string(setProperty(setProperty(body('Parse_JSON')?['actions'][0],'listName','NewListNameByFlow'),'addNavLink',true)),'\','\\'),'"','\"')}]}"}
Power Automate create SharePoint list from existing one

Summary

You’ve got multiple options how to create a new SharePoint list with Power Automate. You can either define all the requests for all the columns by yourself, or you can let SharePoint do the work. My preference goes to the 3 actions above. Create the list in SharePoint, get its schema, process it a bit, and use it to create a new list. And if needed, you can add it also to the site navigation, change the list name, or modify permissions of the new list.

You can use the same approach also to move lists between different environments. Export the list using the first HTTP request, store the output in a text editor, and then use it as the input on the other environment. Just keep in mind that you’re copying only the list structure, not the list data.


🚀 Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

90 thoughts on “Create new SharePoint list from existing SP list with Power Automate”

  1. Ben says:
    June 2, 2021 at 6:42 pm

    I’ve been meaning to learn how to reverse-engineer API calls using a web browser for a long time now, and this was a great introduction to the process!

    I’d note that your example works because you are duplicating the list in a different site. If you try to duplicate the list in the same site, you will get an error message because you can’t create a second list with the same name. (The HTTP action will complete successfully, by the way, but no list will be created, and if you examine the output you’ll see the error message about the name already existing.)

    I got around this by using a Select action to re-map all of the elements in the ‘actions’ array. I set my own listName manually, and everything else I just mapped to the coresponding output from the Parse JSON action.

    Then I put the Select output into the ExecuteTemplateScript() call the same way you did, converting it to a string and replacing the special characters.

    Thanks for this tutorial!

    Reply
    1. Tom says:
      June 6, 2021 at 8:28 pm

      Hello Ben,
      thank you for the tip on changing the list name, I didn’t use it on the same site so I didn’t even think about that.

      Reply
    2. Adrianna says:
      June 10, 2022 at 2:17 pm

      Could you please share your solution? I have exactly the same problem.

      Reply
      1. Tom says:
        June 19, 2022 at 9:34 am

        Hello Adrianna,
        there’s another post on renaming the new list: https://tomriha.com/change-the-name-of-sharepoint-list-from-template-with-power-automate/

        Reply
    3. Adam Haas says:
      October 17, 2022 at 5:47 pm

      How did you use Select? What did you specify for “From”?

      Reply
  2. Michael says:
    June 10, 2021 at 6:08 am

    Brilliant, just what a novice like me was looking for!

    Reply
  3. Popky says:
    June 24, 2021 at 1:48 pm

    In case your Parse JSON throws errors, check if Power Automate does not overwrite the Dynamic Content in ‘Content’ field…
    thx Tom (y)

    Reply
  4. Mike says:
    July 7, 2021 at 6:19 am

    Legend, this is great theres nothing else like this that i could find just how to create lists/add fields
    Thanks very much

    Reply
  5. Glenn Leong says:
    July 10, 2021 at 12:49 am

    Hi there, your guide works mostly, but I find that I have 2 issues:
    1. GetSiteScriptFromList does not return the ‘addNavLink’ in its results and so the list does not add to the navigation. I have tested with lists from different sharepoint sites to make sure they aren’t configured incorrectly. Do you get this behaviour now too? Is there a bug with this function?

    2. When the list is copied over the advanced setting ‘allow management of content types’ is enabled , do you get the same behaviour? Also how do I configure that to be off by default as my original list has it by default.

    Would appreciate any help with the above, I’ve been trying for the last couple of days and getting nowhere.

    Thanks for the guide!

    Reply
    1. Tom says:
      July 13, 2021 at 4:08 pm

      Hello Glenn,
      1. it’s not added automatically to the navigation, you’ll need another HTTP request to add it.

      Method: POST

      Uri:
      _api/web/navigation/QuickLaunch

      Headers:
      Accept : application/json;odata=verbose
      Content-Type : application/json;odata=verbose

      Body:
      {
      "__metadata": {
      "type": "SP.NavigationNode"
      },
      "Title": "LinkName",
      "Url": "Url to the list"
      }

      2. My list doesn’t have enabled management of content types, I’d try to turn it on and off on the original list and then create the list again. It’s using the out of the box functionality for copying lists so it should be 1:1, unless there’s something strange in the original list.

      Reply
  6. marcel says:
    July 13, 2021 at 3:55 pm

    We have struggle SO MUCH to get something like this working. Your solution works perfectly. Thank you so much!!!
    As previous poster, do you have a quick tip on adding the SP list to the navigation?

    Reply
    1. Tom says:
      July 13, 2021 at 4:11 pm

      Hello Marcel,
      you’ll need a separate HTTP request to SharePoint to add it to the navigation, please take a look on my response above.

      Reply
  7. Glenn says:
    July 14, 2021 at 2:24 am

    Hi Tom,
    I am unable to reply directly to your comment, the reply link doesn’t work.

    With regards to what you have mentioned with GetSiteScriptFromList not including the navbar addition, the documentation example from Microsoft indicates that the nav bar is included in the response, also some other blogs show this as the response too, so I thought maybe we were doing something wrong? Reference: https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/site-design-rest-api

    With regards to manage content types, I just tested again with a separate site, created a new list and used your method described above. ‘Allow management of content-types’ was enabled by default, while on the original site this was disabled by default.

    Reply
    1. Tom says:
      July 14, 2021 at 1:44 pm

      Hello Glenn,
      I checked the link you shared, but the GetSiteScriptFromList() method didn’t return the ‘addNavLink’ and the ExecuteTemplateScript() method failed when I used the example in the documentation as the input. But I found out that the ‘addNavLink’ property can be added to the input of the ExecuteTemplateScript(), it’s described in the new post.
      For the content types, I’m not able to emulate this behaviour on my environment, so I can only recommend adding an http request that’ll disable content types after you create the list. I believe this request should do that if you use ‘false’ instead of ‘true’.

      Reply
  8. Victoria says:
    July 26, 2021 at 2:31 am

    Instead of re-mapping all the elements using a Select action (I couldn’t figure this out at all), I added another replace() to the last section.
    Body:
    {“script”: “{\”actions\”:@{replace(replace(replace(string(body(‘Parse_JSON’)?[‘actions’]), ‘name of the original list’, ‘name of new list’), ‘\’,’\\’),'”‘,’\”‘)}}”}

    I also initialized a variable after the first step since I needed to create multiple lists with similar names.

    Reply
  9. Carl Peterson says:
    September 16, 2021 at 12:58 pm

    Great job! However, all of a sudden this error message shows up everytime I run the flow:
    Unable to process template language expressions in action ‘Parse_JSON’ inputs at line ‘1’ and column ‘10402’: ‘Required property ‘content’ expects a value but got null. Path ”.’.
    Anyone got this too?

    Reply
    1. Tom says:
      September 22, 2021 at 5:53 pm

      Hello Carl,
      I just tried it and the solution works fine for me, don’t you have some typo in there? Are you referencing the right actions, using the right dynamic content?

      Reply
  10. John says:
    October 3, 2021 at 2:29 am

    Hi,

    This is the closest I’ve got to cloning a list format. However, my flow ‘hangs’ on the create list bit. List has manage content enabled. Not sure what I’ve done wrong. Any advise>

    Reply
    1. Tom says:
      October 4, 2021 at 6:33 pm

      Hello John,
      I tried a list with content type management enabled and the list was created, even though the content type management was not enabled on the new list, but I didn’t encounter any issues during creation.

      Reply
  11. Candice says:
    October 25, 2021 at 8:20 pm

    Thank you for the article. Is there a way to name my new list after it is created?

    Reply
    1. Tom says:
      October 29, 2021 at 9:15 am

      Hello Candice,
      you can change the list name using the ‘Send an HTTP request to SharePoint’ action:
      Method: POST
      Uri: _api/web/lists/getByTitle('currentListName')

      Headers:
      Accept : application/json;odata=verbose
      Content-Type : application/json;odata=verbose
      IF-MATCH : *
      X-HTTP-Method : MERGE

      Body:
      {
      "__metadata": {
      "type": "SP.List"
      },
      "Title": "newListName"
      }

      As shown for example here: https://tomriha.com/wp-content/uploads/2021/10/rename-list.png

      Reply
  12. Beatriz says:
    November 13, 2021 at 2:41 pm

    THANK YOU SO MUCH!!! I implemented your solution with the tweak that Victoria posted in her comment and it works perfectly. I learned so much! Sadly I couldn’t reply to her comment to left her a thank-you note also, is the ‘reply’ button not working on the comments? Thanks again!

    Reply
    1. Tom says:
      November 17, 2021 at 9:04 pm

      Hello Beatriz,
      I already noticed the ‘Reply’ button doesn’t work, it seems it’s broken in this WordPress theme and I’ll have to either fix it or change the theme. :/

      Reply
  13. Graham says:
    November 16, 2021 at 2:58 am

    This is great but how do you set a new name for the new list? You have everything, get list, create new list but it is creating a new list in the same site, so since the list exists it wont create a new list, we need a line to add a new list name.

    Reply
    1. Tom says:
      November 17, 2021 at 9:46 pm

      Hello Graham,
      I described the solution in the new article, I hope it helps: https://tomriha.com/change-the-name-of-sharepoint-list-from-template-with-power-automate/

      Reply
  14. Drake Josh says:
    January 21, 2022 at 2:52 am

    I am getting a bad gateway error.

    What exactly did you put for the content of the Parse JSON? Can I just call the body of the “Send an HTTP Request to SharePoint – get list structure”?

    Reply
    1. Tom says:
      January 23, 2022 at 5:38 pm

      Hello Drake,
      I did run the ‘Send an HTTP request to SharePoint’ once, copied the whole output of the action, and used it as a sample data in the ‘Parse JSON’ action.

      Reply
  15. Deanna says:
    February 10, 2022 at 6:32 pm

    This was a lifesaver – thank you!

    Reply
  16. Monique M. says:
    February 10, 2022 at 10:57 pm

    Hello Tom, I continue to get “Bad Gateway” at the HTTP request to SharePoint Output field. And I am stumped. Can you help me?

    {
    “error”: {
    “code”: 502,
    “source”: “flow-apim-msmanaged-na-centralus-01.azure-apim.net”,
    “clientRequestId”: “4291d0e4-20e9-49c9-9fc2-d9cd5c52de12”,
    “message”: “BadGateway”,
    “innerError”: {
    “status”: 502,
    “message”: “Unexpected character encountered while parsing value: }. Path ‘actions’, line 1, position 11.\r\nclientRequestId: 4291d0e4-20e9-49c9-9fc2-d9cd5c52de12\r\nserviceRequestId: e67c1fa0-90bf-c000-d97a-1eb712da8255”,
    “source”: “https://shutterfly.sharepoint.com/sites/MoniquesTestSite/Archive/_api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.SiteScriptUtility.ExecuteTemplateScript()”,
    “errors”: [
    “-1”,
    “Newtonsoft.Json.JsonReaderException”
    ]
    }
    }
    }

    Reply
    1. Tom says:
      February 13, 2022 at 6:44 pm

      Hello Monique,
      based on the error message there’s something wrong with the Body of the HTTP request, I’d take a look on the request Body if you didn’t miss any of the characters.

      Reply
      1. Monique M. says:
        February 15, 2022 at 5:20 pm

        Thank you Tom for your reply. The Body text was copied from you example.

        {“script”: “{\”actions\”:@{replace(replace(string(body(‘Parse_JSON’)?[‘actions’]),’\’,’\\’),'”‘,’\”‘)}}”}

        And it continues to produce the Error for Bad Gateway.

        Reply
        1. Tom says:
          February 19, 2022 at 11:40 am

          Hello Monique,
          maybe there’s a problem in one of the previous actions, I’d try to build the flow again from scratch using the guide, in case you missed some step.
          I just tried to build the flow again in case anything changed but it still works fine.

          Reply
        2. Deb B says:
          March 14, 2022 at 9:59 pm

          Monique, Did you figure this out? I am also getting a bad request error.

          Reply
          1. Deb B says:
            March 15, 2022 at 5:34 pm

            I figured out what I was doing wrong. I missed this step: outputs(”)?[‘body’]?[‘d’]?[‘GetSiteScriptFromList’]

            I was just using the body of the previous step when I needed to use the expression.

  17. Aurelien Sam'S says:
    April 6, 2022 at 12:00 pm

    Hello,
    For two months now I have been using this method without any problem but since this morning I have this error:

    {
    “statusCode”: 502,
    “headers”: {
    “Pragma”: “no-cache”,
    “x-ms-request-id”: “020231a0-90ac-3000-dc1e-f19fc5320a03”,
    “Strict-Transport-Security”: “max-age=31536000; includeSubDomains”,
    “X-Content-Type-Options”: “nosniff”,
    “X-Frame-Options”: “DENY”,
    “Cache-Control”: “no-store, no-cache”,
    “Set-Cookie”: “ARRAffinity=83861925a169265c5920d3fde20c675d8c76e073149c10339f818dd220368227;Path=/;HttpOnly;Secure;Domain=sharepointonline-we.azconn-we-002.p.azurewebsites.net,ARRAffinitySameSite=83861925a169265c5920d3fde20c675d8c76e073149c10339f818dd220368227;Path=/;HttpOnly;SameSite=None;Secure;Domain=sharepointonline-we.azconn-we-002.p.azurewebsites.net”,
    “Timing-Allow-Origin”: “*”,
    “x-ms-apihub-cached-response”: “true”,
    “x-ms-apihub-obo”: “true”,
    “Date”: “Wed, 06 Apr 2022 08:17:36 GMT”,
    “Content-Length”: “708”,
    “Content-Type”: “application/json”,
    “Expires”: “-1”
    },
    “body”: {
    “error”: {
    “code”: 502,
    “source”: “europe-002.azure-apim.net”,
    “clientRequestId”: “0cf747c4-446e-4c1d-ba8f-174332a87ace”,
    “message”: “BadGateway”,
    “innerError”: {
    “status”: 502,
    “message”: “La demande utilise trop de ressources.\r\nclientRequestId: 0cf747c4-446e-4c1d-ba8f-174332a87ace\r\nserviceRequestId: 020231a0-90ac-3000-dc1e-f19fc5320a03”,
    “source”: “https://sibracacam.sharepoint.com/sites/test.intranet.sabc/test_dev/_api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.SiteScriptUtility.GetSiteScriptFromList()”,
    “errors”: [
    “-2146232832”,
    “Microsoft.SharePoint.SPRequestLimitExceededException”
    ]
    }
    }
    }
    }
    Can you help me please

    Reply
    1. Tom says:
      April 13, 2022 at 2:27 pm

      Hello Aurelien,
      I just tried it on my tenant and it works fine, there must be something different either in the request input (the list you’re trying to replicate) or somewhere in your tenant settings. I’d start by checking if there was any change in the source list since the last successful run.

      Reply
  18. Sarah says:
    April 26, 2022 at 3:13 am

    Hello, this is fantastic thank you so much for creating it. I’ve used the tweak that Victoria mentioned but tweaked it to use a concatenated name made from an earlier variable, and in one situation it works perfectly, however in another I am getting an error -2147467259 Outcome 1 ‘Something went wrong and we could not complete the action’

    In the step of sending the HTTP request to create the list after Parse JSON this is the code for the body of the working list

    {“script”: “{\”actions\”:
    @{replace(replace(replace(string(body(‘Parse_JSON_-_RisksandLessons’)?[‘actions’]), ‘Risks and Lessons Register’, concat(variables(‘EventName’), ‘ Risk and Lessons Register’)), ‘\’, ‘\\’), ‘”‘, ‘\”‘)}
    }”}

    However my other list, (same site, same accounts etc) works with a fixed name

    {“script”: “{\”actions\”:
    @{replace(replace(replace(string(body(‘Parse_JSON’)?[‘actions’]),’Log’,’Newname1′),’\’,’\\’),'”‘,’\”‘)}
    }”}

    But when I introduce the concatenated variable name, I get the something went wrong error
    {“script”: “{\”actions\”:
    @{replace(replace(replace(string(body(‘Parse_JSON_-_Log’)?[‘actions’]),’Log’,concat(variables(‘EventName’),’ Log’))
    ,’\’,’\\’),'”‘,’\”‘)}
    }”}

    Bet i’m missing something simple!

    Reply
    1. Tom says:
      May 3, 2022 at 7:44 pm

      Hello Sarah,
      that’s strange, I don’t see any problem in the expression. I’d try two things:
      1. try to build the new name before the expression, e.g. in a ‘Compose’ action and then use the output of this ‘Compose’ as the new name
      2. change the name by updating the ListName property directly as described here: https://tomriha.com/change-the-name-of-sharepoint-list-from-template-with-power-automate/

      Reply
  19. Kevin says:
    July 12, 2022 at 11:06 am

    Hi Tom,

    This is great and I can create a new SP list from existing list successfully. However, is there any method to copy the items from existing list to new SP list at the same time? Thanks!

    Reply
    1. Tom says:
      July 17, 2022 at 7:27 pm

      Hello Kevin,
      if you want to copy also the items then you must add such functionality to the flow, I didn’t see any function that would do that. I’d recommend checking Paul’s solution: https://www.tachytelic.net/2021/06/power-automate-flow-batch-create-sharepoint-list-items/

      Reply
  20. Carlos says:
    July 23, 2022 at 11:31 pm

    Hi Tom,

    Sorry to bother you, but sadly, I tried to follow your suggested steps but I had no success. I admit that I am absolutely new to SharePoint, PowerAutomate, PowerApss, etc. and I am not a developer either. However, I am trying to improve a corporate process in our department using SharePoint and PowerAutomate but it seems nobody can’t do what I want. I have reviewed several YouTubers and the don’t really explain it well enough for a NON-IT guy to follow the steps. I hope you can help.

    1st, how do you start the flow? what is your trigger? I selected “SharePoint for a selected file” so that I can add a step and attempt the post you were instructing but then in the body how can I get those placeholders you are mentioning> “sourcesite” and “sourcelist” I did the following but I can’t test it at this time.
    Could you please give me some more orientation?

    body:
    {
    “listUrl”:”https://COMPANY.sharepoint.us/sites/https://COMPANY.sharepoint.us/sites/NAMEOFTHESITE/SitePages/ProjectHome.aspx/Lists/https://COMPANY.sharepoint.us/sites/NAMEOFTHESITE/Lists/CHKLST%202Template/AllItems.aspx/”
    }

    Thank you

    Reply
    1. Tom says:
      August 1, 2022 at 7:33 pm

      Hello Carlos,
      the trigger should be either a manual trigger if you want to run the flow on demand, or it could be some scheduled trigger if you create lists on regular basis.
      For the body, it expects only 1 url. If you need multiple lists you’ll have to repeat the process for all of them one by one.

      Reply
  21. Mirko says:
    September 21, 2022 at 4:29 pm

    Hi Tom. We build the flow like: https://tomriha.com/create-new-sharepoint-list-from-existing-sp-list-with-power-automate/
    but we get the Error: (addSPLookupFieldXml)
    last week worked the flow well with your instruction for the HTTP requests and there were no problems

    Reply
    1. Tom says:
      September 27, 2022 at 3:58 pm

      Hello Mirko,
      I’d check if there wasn’t some change in the lists. If it worked before and now it doesn’t work anymore then there must’ve been some change.

      Reply
  22. Ravi Kumar Singh says:
    October 2, 2022 at 11:05 am

    How to create a New XML form library from an existing form library using power automate?

    Reply
    1. Tom says:
      October 14, 2022 at 10:02 am

      Hello Ravi,
      I have no idea, never did that.

      Reply
  23. Gino says:
    November 18, 2022 at 2:46 pm

    Hello Tom, thank you very much for this superb tutorial. Everything works, but my only problem is that it doesn’t create the requested list for me. When I look at the body of my JSON I see that it always gives me the same list as well as the one I asked for. Do you have an idea.

    thanks again

    Reply
    1. Gino Paquin says:
      November 18, 2022 at 3:10 pm

      Hello Tom, Forget my question, I solved my problem

      thanks again

      Reply
  24. Jarbas says:
    December 1, 2022 at 3:04 am

    Hi!

    The JSON is showing 3 lists. At the end of the flow it does not create a new one, saying that the list already exists.

    The list that is to be cloned is TEMPUS. Can you help me?

    {
    “$schema”: “https://developer.microsoft.com/json-schemas/sp/site-design-script-actions.schema.json”,
    “actions”: [
    {
    “verb”: “createSPList”,
    “listName”: “ls_areas_clientes”,
    “templateType”: 100,
    “color”: “7”,
    “icon”: “8”,
    “subactions”: [
    {
    ……….(removed tooo long)*****
    }
    ]
    },
    {
    “verb”: “createSPList”,
    “listName”: “ls_projetos”,
    “templateType”: 100,
    “color”: “11”,
    “icon”: “11”,
    “subactions”: [
    {
    ……….(removed tooo long)*****

    {
    “verb”: “createSPList”,
    “listName”: “TEMPUS”,
    “templateType”: 100,
    “color”: “11”,
    “icon”: “3”,
    “subactions”: [
    {
    “verb”: “addSPFieldXml”,
    “schemaXml”: “”
    },
    {
    “verb”: “addSPFieldXml”,
    }
    ]
    }
    ]
    }

    Reply
    1. Tom says:
      December 15, 2022 at 1:34 pm

      Hello Jarbas,
      it contains 3 lists because the TEMPUS list contains lookup on the other 2 lists – if there’s a lookup it’ll create the other lists too. I’d create a “template” list without the lookup columns, create it using the requests in this article, and then add the lookup columns using another http requests. (https://tomriha.com/how-to-create-a-new-sharepoint-list-column-with-power-automate-flow/)

      Reply
  25. Anurag Porwal says:
    January 12, 2023 at 8:26 pm

    Any how to do this with data?

    Means i also want to migrate list data, Create new SharePoint list from existing SP list with Power Automate with complete data migration.

    Thanks in Advance

    Reply
    1. Tom says:
      January 26, 2023 at 2:55 pm

      Hello Anurag,
      if it’s in the same environment you can ‘Get items’ from the original list and then ‘Create item’ one by one in the second list. If it’s two different environments you’ll need some step in between, e.g. export them in Excel file, store the Excel file in the target environment and copy it from there into SharePoint.

      Reply
  26. Ali says:
    March 8, 2023 at 5:26 am

    Hi Tom,

    Thank you for detailed explanation. I want to use this flow to create more than 200 similar lists in our SharePoint but have 2 small problems running the flow.
    1. Sometimes it’s working and sometimes it is stuck at last step and keep retrying.
    2. When the list created, the fields are there but hidden.
    Any suggestions?

    Reply
    1. Tom says:
      March 19, 2023 at 3:30 pm

      Hello Ali,
      no helpful thoughts about the retrying, but if columns are missing from a view you can add them with an http request: https://tomriha.com/adding-a-new-column-to-sharepoint-view-with-power-automate/

      Reply
  27. Dharshan says:
    March 10, 2023 at 9:50 am

    Hi Tom,

    This Solution Work fine for the Lists and it is really impressive no doubt, But I have to Copy Document Library columns from existing SharePoint to New SharePoint, But the Catch here is the Default document Library Already exists. Basically I need to update my Document Library columns from Existing Document Library. Is there any solution for the Problem.

    Reply
    1. Tom says:
      March 19, 2023 at 3:35 pm

      Hello Dharshan,
      if the library already exists then you can create just the columns inside: https://tomriha.com/how-to-create-a-new-sharepoint-list-column-with-power-automate-flow/

      Reply
  28. JP says:
    April 20, 2023 at 4:28 pm

    Running across this post was exactly what I needed. While I could use a template list from the existing site, there are other customizations that I’ll need to do and I’m trying to use the second half of this to execute a custom script. My site has site columns defined and the schema (https://developer.microsoft.com/json-schemas/sp/site-design-script-actions.schema.json) does include an action for addSiteColumn, but this seems to always cause error -2147467259 when the script is run. Any suggestions on resolving this? Is it possibly because the addSiteColumn action includes an addToDefaultView property that can’t be set if there isn’t a Default View defined prior to that action?

    Reply
    1. Tom says:
      May 7, 2023 at 2:11 pm

      Hello JP,
      no suggestions, I didn’t try this using site columns, maybe the requests are different if there’re site columns but that’s something you’d recognise only if you debug the traffic in a browser console as I did for this solution.

      Reply
  29. D2 says:
    May 2, 2023 at 4:32 pm

    Finding this article was a great find, but everything stopped working a week ago.
    _api/Microsoft.Sharepoint.Utilities.WebTemplateExtensions.SiteScriptUtility.GetSiteScriptFromList() is now returning improper JSON. An example below show an example of one of the changes, but also other attributes are being displayed.
    Before
    \”listName\”: \”DCNfiles\”
    After
    \”listName\”: \”[[LDCNfiles0001_listName]]\”

    I’ve isolated to a single control, attempted new list and libraries, and tried on multiple tenants all with the same results. I even attempted using the Get-SPOSiteScriptFromList PowerShell command and it returned bad results.

    Has anyone else experienced this or know if there is a way around it?

    Reply
    1. Dharshan P R says:
      June 2, 2023 at 12:34 pm

      Hi I am also facing the Same issues, any workaround ?

      Reply
    2. Aneris says:
      July 11, 2023 at 1:03 pm

      Hi, I am facing the very same issue today. I have followed this article but without success. I got the same error with the source list name, as D2 discribed above.

      Reply
      1. Tom says:
        August 13, 2023 at 3:07 pm

        Hello Aneris,
        try the updated Body expression from the article.

        Reply
    3. Deanna says:
      August 7, 2023 at 7:47 pm

      Having the same problem as well. Looks like it’s a known issue:

      https://techcommunity.microsoft.com/t5/sharepoint-developer/provisioning-sitescript-generation-changes-causing-errors-in/m-p/3811626

      I’m working through the above to resolve.

      But, Tom, you document things so well! Any chance of updating this article?

      Thanks!

      Reply
      1. Tom says:
        August 13, 2023 at 3:08 pm

        Hello Deanna,
        I updated the article, there’re a few more things to do with the schema – define whether the list should be added to the navigation and rename the list to some prettier name.

        Reply
    4. Tom says:
      August 13, 2023 at 3:03 pm

      Hello D2,
      I updated the article to reflect this change.

      Reply
  30. Rakesh says:
    May 17, 2023 at 2:24 pm

    Hi Tom,

    I tried this workaround and everything works perfect except the rules over list. When I run “GetSiteScriptFromList” it gives me max 2 rules from source list. Where I have 15 rules on my source list. Is this a bug or a limitation and how to solve this. Please Help

    Reply
    1. Tom says:
      July 28, 2023 at 8:46 am

      Hello Rakesh,
      I never tried it on list with rules so I can’t tell for sure. Try to recreate the list using the SP UI to see whether it’ll copy all the rules – in the end this solution just replicates the same functionality so it should work in the same way.

      Reply
  31. James says:
    June 1, 2023 at 4:28 pm

    Thank you so much for this solution. I did notice that even though the lists are created with the correct column structures (internal/static and display names, type, and choice options, etc.), the list name is created with the display name rather than the internal/static name.

    How can we create the lists with the internal/static name and also assign the display name, per the source?

    Reply
    1. Tom says:
      August 12, 2023 at 10:36 pm

      Hello James,
      you’ll need another HTTP request to rename the list as explained here: https://tomriha.com/how-to-rename-sharepoint-lists-using-power-automate-flow/

      Reply
  32. Ben says:
    November 10, 2023 at 1:15 am

    This is amazing! One question if you have ideas…I have a template that references itself (lookup column). Is there any way you know to make that reference the new list?

    Sorry – had accidentally posted this on the wrong article.

    Reply
  33. Bo says:
    March 25, 2024 at 2:43 pm

    This is a great feature, however it does not work, if the source list has any Lookup Columns to other lists in the same web. Then the copy will be of that list, and not the one intended.
    Do you have a fix for that? I could not figure out a solution. But works perfect if the source list has no lookups.

    Reply
    1. Tom says:
      April 17, 2024 at 10:17 pm

      Hello Bo,
      if the list has lookup it’ll create also the other list to be able to create the lookup column, but then the renaming doesn’t work very well. When I did a template with lookup in the past I created the lists without the lookup column and then added it as an extra step with another HTTP request after the 2 lists were created.

      Reply
  34. Ivan says:
    April 17, 2024 at 10:14 pm

    This article has ended days of research after trawling site after site without success for exactly this solution!
    Thank you so much, truly appreciated 🙂

    Reply
  35. robert says:
    June 26, 2024 at 5:49 pm

    I can`t get the first request to work, getting the list template script,

    pretty sure something is wrong with the listUrl, can someone please post a working listUrl, what exactly do you input after Lists/ the list name or the list id?

    This is how mine looks, and I always get bad gateway.
    {
    “listUrl”: “https://CensoredTenantName.sharepoint.com/sites/CensoredSiteName/Lists/CensoredListName/”
    }

    Reply
  36. Dave says:
    August 1, 2024 at 8:18 pm

    Thank you for helpful posts.

    Is it possible to also copy of the list content at the same time? Currently using the Get Items and then Apply To Each to recreate the list line by line. There’s probably a more efficient way.

    Reply
  37. Dave says:
    August 2, 2024 at 4:21 pm

    Stange things happening…

    My list has a lookup column with cascade deletion dependency. When I Send the HTTP request to SharePoint to get script from list, it returns the lookup column list and not the list that I specified with the Url. I deleted the lookup column and it returned the correct list script.

    Any idea what’s going on here?

    Reply
    1. Kenny says:
      January 13, 2025 at 3:37 pm

      Hi Dave, were you able to find a work around for lists with lookup fields?

      Reply
      1. Kenny says:
        January 13, 2025 at 4:31 pm

        So, after a bit of time battling with this, I remembered that inorder to create a list with a lookup field, the List being looked up has to first be created . The other list you said you saw is the lookup list, your list should be included in the action array. You can use a parse json to read the action itself and do an apply to each for each list object as opposed to one that the author did.

        Reply
  38. Rafel says:
    September 25, 2024 at 1:15 pm

    Nice job. I have a question: how to do the flow will give the user posibility to dynamically selects the names of the lists? What I mean is that the flow works in such a way that the user does have to know how to use Power Automate, but dynamically has the ability to indicate the lists from which the data is copy and to which it is copied.

    Reply
  39. Kenny says:
    January 13, 2025 at 3:36 pm

    Hi Tom. This is beautiful, thank you.

    I have a question, but don’t know if i’ll get a response here, I see you haven’t responded to the most recent comments you’ve had…and it’s been months.

    I was able to implement the solution you described, but I noticed it was creating a wrong list. after a bit of troubleshooting, I noticed the first api request was returning multiple lists, hence since we’re picking the furst object, and the list I specified apparently was the last in the action array. It was creating for the other list. I tried filtering for the specific one i wanted, but The second api request failed with error code: -1593311229 and error message : “OutcomeText”: “Parameter targetListName references a resource that could not be found.”.

    Do you know what could be causing this? If i specify any other list object apart from the first one, it fails.

    NB: The other lists returened are any list that’s related to the specified lidt(lookup column’s list)

    Reply
    1. Kenny says:
      January 13, 2025 at 4:39 pm

      So, after a bit of time battling with this, I remembered that in order to create a list with a lookup field, the List being looked up has to first be created . I will find a way to create this lists first withing the same flow

      Reply
      1. Tom says:
        February 21, 2025 at 9:06 pm

        Hello Kenny,
        you’re right, it’s creating all the connected lists – if there’re some lookup columns it’ll create the related lists too before the main list so it can reference it. The solution is to create the other lists before the one with the lookup as you mentioned in the other comment.

        Normally when I create lists these days I prefer to build them column by column (https://tomriha.com/how-to-create-a-new-sharepoint-list-column-with-power-automate-flow/) as I feel it’s a less “black box” solution than this one, although it’s a bit more work than just copy the list.

        Reply
  40. deej says:
    February 5, 2025 at 2:33 pm

    Is this supposed to actually clone the list and create fields? Flow works, but the second Http Request action, if you rename the list, it does not actually include the rest of the body output from the Parse action which has the entire template? I.e. list is created, but only with a Title column?

    Reply
    1. Tom says:
      February 21, 2025 at 9:14 pm

      Hello Deej,
      yes, it should create 1:1 copy of the existing list, all the columns, but no data. It’s the same as when you create a new list “From existing list” manually.

      Reply
  41. Lee says:
    March 8, 2025 at 9:30 am

    Hello Tom, i really appreciate this, thank you. Now i would like to do this in bulk, i.e., to different sharepoint site. Do you have any article that you can point me to? Thanks!

    Reply
    1. Tom says:
      March 17, 2025 at 9:19 pm

      Hello Lee,
      I’d say this is quite similar solution – https://tomriha.com/send-multiple-sharepoint-reminders-in-a-single-power-automate-flow/. Prepare an array with the configuration, loop through that array, and create the lists one by one using the configuration items.

      Reply
  42. Jeff says:
    March 19, 2025 at 11:23 am

    Hi Tom,
    Thanks for this, it will make my project much easier them creating the lists from scratch each time.

    Do you know if its possible to also copy across a custom form with the list?

    Reply
    1. Tom says:
      April 5, 2025 at 9:02 am

      Hello Jeff,
      it’s been a while since I used this solution but I’d guess it should transfer the custom form too as it’s a 1:1 copy of the list and it transfers all the column formatting. Unless it’s a PowerApps (that’s a separate solution to transfer https://tomriha.com/reconnect-power-automate-flow-to-a-different-sharepoint-site-lists/) or Forms form (I didn’t use those yet so I don’t know).

      Reply
  43. Joel says:
    March 25, 2025 at 3:50 pm

    This is absolutely what I needed, fairly easy to follow.
    My question is how can you add the newly created SP List to Power App using either Power Automate or with a button in Power Apps.

    Reply
    1. Tom says:
      April 5, 2025 at 9:13 am

      Hello Joel,
      that’s an interesting question but I never tried that. Not sure if it’s doable though as all the data sources are hard coded in PowerApps, the only dynamic reference being environment variables that you could potentially update. But there’s still a hard coded number of the environment variables in an app.
      You could probably do it if you don’t connect the app directly to the lists but use a flow on the background that would collect the data from all lists defined in some configuration list.

      Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

🚀 Master Power Automate

Join 2,000+ professionals getting actionable Power Automate tutorials, solutions, cheat sheets & tips every week.

No spam. Unsubscribe anytime.

Working on an Approval process?

Use the Approval Process Template and the Task Delegation App to skip the hard part and deploy a fully functional approval solution on a SharePoint list in minutes! And then the next one, and the next one...

Approval Template Preview ✨ Learn more ✨

Turn ideas into flows with ease!

Grab the complete Power Automate Cheat Sheet Bundle—everything you need to master expressions, SharePoint HTTP calls, and Graph API in Power Automate.

Cheat Sheet Bundle Preview ✨ Get the Cheat Sheets

Didn't find what you were looking for?
Need to adjust a solution to fit your needs?
Or would you just like to get an assistance from somebody with thousands of hours of experience with Power Automate?

Power Automate blogs worth visiting

Damien Bird
Dennis (Expiscornovus)
Paul Murana

©2025 Let's POWER Automate | Theme by SuperbThemes