“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 >.
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.
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’.
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','NewListName'),'addNavLink',true)),'\','\\'),'"','\"')}]}"}
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.
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!
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.
Could you please share your solution? I have exactly the same problem.
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/
How did you use Select? What did you specify for “From”?
Brilliant, just what a novice like me was looking for!
In case your Parse JSON throws errors, check if Power Automate does not overwrite the Dynamic Content in ‘Content’ field…
thx Tom (y)
Legend, this is great theres nothing else like this that i could find just how to create lists/add fields
Thanks very much
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!
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.
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?
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.
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.
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’.
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.
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?
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?
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>
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.
Thank you for the article. Is there a way to name my new list after it is created?
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
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!
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. :/
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.
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/
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”?
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.
This was a lifesaver – thank you!
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”
]
}
}
}
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.
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.
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.
Monique, Did you figure this out? I am also getting a bad request error.
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.
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
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.
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!
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/
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!
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/
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
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.
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
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.
How to create a New XML form library from an existing form library using power automate?
Hello Ravi,
I have no idea, never did that.
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
Hello Tom, Forget my question, I solved my problem
thanks again
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”,
}
]
}
]
}
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/)
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
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.
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?
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/
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.
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/
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?
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.
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?
Hi I am also facing the Same issues, any workaround ?
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.
Hello Aneris,
try the updated Body expression from the article.
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!
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.
Hello D2,
I updated the article to reflect this change.
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
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.
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?
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/
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.
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.
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.
This article has ended days of research after trawling site after site without success for exactly this solution!
Thank you so much, truly appreciated 🙂
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/”
}
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.
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?
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.