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

Change the name of SharePoint list ‘from template’ with Power Automate

Posted on November 17, 2021October 22, 2023 by Tom

“You have everything, get list template, create new list but it is creating a new list with the same name, if it already exists Power Automate won’t create a new one.”


As pointed out in the comments, the solution to create a new SharePoint list from an existing one can be extended. As it is now, it’ll always create the list with the same name. But if you use it within the same site, you can’t create multiple lists with the same name. In these situations you might need to define a new name for the list. And this article will show you how.

Change the list name

IMPORTANT Note: the request now returns the list name in a strange format, use the request in the original article!

As already shown in the original article, list name is one of the properties in the JSON. By default it’s the name of the source list, but it’s not fixed. If you change the value of that property, you can change the name of the new list.

Power Automate list template name

It’s a similar approach as when you add the list to the navigation. You must take the content of the ‘actions’ object, and change it. When adding the navigation, you’re adding a new property. This time the property already exists, it’s the ‘listName’. Therefore, you can just change it using the setProperty(…) expression.

The setProperty(…) will take an object, find a property, and set it to the desired value, e.g.

setProperty(<actions>, 'listName', 'New list name')

Note: the <actions> part is just a simplified string, it’s not the real input.

Add it to the expression used to create a list (without navigation):

replace(replace(string(setProperty(body('Parse_JSON')?['actions'][0],'listName', 'New list name')),'\','\\'),'"','\"')

Or to the expression used to create a list including the navigation:

replace(replace(string(setProperty(addProperty(body('Parse_JSON')?['actions'][0],'addNavLink',true),'listName','New list name')),'\','\\'),'"','\"')

Summary

When you create a new SharePoint list from a template, Power Automate allows you to make some changes, e.g. the name. You just need to find the right property, add it if it’s missing (navigation) or change the value if it already exists (list name).

This solution is designed only for the new lists created from template, if you’d like to rename existing lists there’s a dedicated post.


🚀 Master Power Automate

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

No spam. Unsubscribe anytime.

16 thoughts on “Change the name of SharePoint list ‘from template’ with Power Automate”

  1. Gary says:
    January 7, 2022 at 5:59 pm

    Hi Tom, I was able to use the first solution to create the SP List using the source template but when I try to use the setProperty I am running into trouble. I am looking to use a variable called Events Calendar as the dynamic content for the new SP list name. My expression looks like this:
    Body:
    {“script”: “{\”actions\”:@{replace(replace(string(setProperty(body(‘Parse_JSON’)?[‘actions’][0],’listName’,variables(‘Events Calendar’))),’\’,’\\’),'”‘,’\”‘)}}”}

    Not sure where I am going wrong… Any advice? Or is it possible to use dynamic content in this way?

    Reply
    1. Tom says:
      January 10, 2022 at 9:10 pm

      Hello Gary,
      you’re missing the [ and ] brackets around the replace(…) expression
      {"script": "{\"actions\":[@{replace(replace(string(setProperty(body('Parse_JSON')?['actions'][0],'listName',variables('Events Calendar'))),'\','\\'),'"','\"')}]}"}

      Reply
  2. Deanna says:
    February 10, 2022 at 6:31 pm

    Thank you! Great info.

    Reply
  3. Patrick says:
    February 14, 2022 at 9:49 pm

    Dear Tom,

    I have a list of roughly 100 existing lists that I would like to rename.

    I am not trying to change the URL of the list, but just the name. I would like to automate the renaming process and therefore consider to write a flow using the replace and setProperty methods.

    Do you have any experience with such a request and do you think the method you explain in your article for newly created lists woudl work for existing lists?

    Kind regards.

    Reply
    1. Tom says:
      February 16, 2022 at 8:40 pm

      Hello Patrick,
      you can’t apply the solution from the article to rename existing lists. To rename them I’d use a configuration list and an HTTP request.
      A configuration list with the site url, current list name and the new list name, similar to this post: https://tomriha.com/copy-files-between-multiple-sp-libraries-in-a-single-power-automate-flow/
      A ‘Send HTTP request to SharePoint’ action in a loop that would take the entries from the configuration list and rename the lists one by one
      Method: POST
      Uri: _api/web/lists/getByTitle('currentListName')
      Headers:
      {
      "X-HTTP-Method": "MERGE",
      "Accept": "application/json;odata=verbose",
      "Content-Type": "application/json;odata=verbose",
      "IF-MATCH": "*"
      }

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

      Reply
  4. Patrick says:
    September 20, 2022 at 10:29 am

    Hi Tom,

    great Work – thank you. Evertyhing works fine – until i use a Lookup Column in my source List.
    Error: (addSPLookupFieldXml) is invalid. Parameter “targetListName” has an invalid value.
    Do you know if there is a way to make it work with lookup columns?

    ty

    Patrick

    Reply
    1. Mirko says:
      September 21, 2022 at 12:46 pm

      we have the same problem. 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 and there were no problems

      Reply
    2. Tom says:
      September 27, 2022 at 3:38 pm

      Hello Patrick,
      I can imagine that renaming a list that’s referenced in a lookup field could cause an issue. In that case I’d try a more brute-force solution by replacing the list name everywhere, not only in the listName property with an additional replace(…), e.g.
      {“script”: “{\”actions\”:@{replace(replace(replace(string(body(‘Parse_JSON’)?[‘actions’]), ‘name of the original list’, ‘name of new list’), ‘\’,’\\’),’”‘,’\”‘)}}”}

      Reply
  5. Tonje says:
    February 20, 2023 at 1:47 pm

    Thank you very much for a very good guide. I want to enter the content from the source list over to the new list. Do you have a guide for this as well? I’m trying now myself, but I can’t get hold of the new list created. Do you know how I can get the ID on the new list?

    Reply
    1. Tom says:
      March 1, 2023 at 10:58 pm

      Hello Tonje,
      the Id of the newly created list should be among the outputs of the list creation action – try to extract it from the output JSON as explained here: https://tomriha.com/get-data-from-http-response-without-parse-json-in-power-automate/. It’ll be probably something like: body(‘Send_an_HTTP_request_to_SharePoint_-_create_list’)?[‘d’]?[‘ExecuteTemplateScript’]?[‘results’][0]?[‘TargetId’]

      Reply
  6. karthik says:
    March 25, 2023 at 10:25 pm

    Hi Tom,

    kindly provide your support on below issue.

    I am facing the issue while creating the list using the template in same site. my flow is showing the success, but list does not present on site. flow showing the “List with name Test_26_3_2023 already exists”.
    1st http body :
    {
    “listUrl”: “https://.sharepoint.com/Lists/Test_26_3_2023/”
    }
    2nd http Body:

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

    2nd http output :
    {
    “d”: {
    “ExecuteTemplateScript”: {
    “__metadata”: {
    “type”: “Collection(Microsoft.SharePoint.Utilities.WebTemplateExtensions.SiteScriptActionResult)”
    },
    “results”: [
    {
    “ErrorCode”: -2130575342,
    “Outcome”: “2”,
    “OutcomeText”: “List with name Test_26_3_2023 already exists.”,
    “Target”: null,
    “TargetId”: null,
    “Title”: “Create or update list \”Test_26_3_2023\””
    }
    ]
    }
    }
    }

    Reply
    1. Tom says:
      April 9, 2023 at 1:06 pm

      Hello karthik,
      I’d check the value that enters the 2nd HTTP request, to see what’s the actual input and if it replaced the list name correctly.

      Reply
  7. Maxim says:
    May 31, 2023 at 2:57 pm

    Hi Tom,
    im using Following code in my HTTP Request Body to create the list and give it a name:

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

    but now im recieving following error

    action 1 (createSPList) is invalid. The paramter “addNavLink”has an invalid value
    clientRequestId: b4f187a5-6e67-4e30-b81c-76049dc9a235
    serviceRequestId: b340b8a0-f0b3-6000-9697-cb7421e6a4d0

    I dont know why this is happening espacially because i didnt even try to add it to Navigation
    Thank you in Advance

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

      Hello Maxim,
      that seems like some issue on Microsoft side, I’m not sure whether it was fixed in the meantime.

      Reply
  8. Stephen Dixon says:
    September 22, 2023 at 1:48 pm

    Anyone know if there is any way around that nav link error yet. I’ve got my flow to same point as Maxim above but kind of stuck now. :O(

    Reply
    1. Tom says:
      October 22, 2023 at 3:33 pm

      Hello Stephen,
      it seems there was a change in the request on Microsoft side and the addNavLink is already there by default, take a look on the original article where I updated the request: https://tomriha.com/create-new-sharepoint-list-from-existing-sp-list-with-power-automate/

      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.

Still exchanging emails to get things approved?

Use the Approval Process Template and the Task Delegation App to skip the hard part and deploy an automated, 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