“I need to rename SharePoint list(s), can I avoid the manual work by building a Power Automate flow that would do it for me?”
There’re many actions using the SharePoint connector in Power Automate, but most of them are related to items or documents. It has no action that would allow you to change any settings on a list. The only available list related actions are ‘Get lists’, ‘Get lists and libraries’ and ‘Get list views’. All of them just return information, none of them does an update.
To update a list, in this situation to change its name, you’ll have to use an HTTP request.
Renaming the list (or library)
The HTTP request needs 3 pieces of information. The first one is the site address, the second one is the current list name, and the last one is the new list name. The request then goes as below:
Method: POST
Uri: _api/web/lists/getByTitle('<current list name>')
Headers:
{
"Accept": "application/json;odata=verbose",
"Content-Type": "application/json;odata=verbose",
"IF-MATCH": "*",
"X-HTTP-Method": "MERGE"
}
Body:
{
"__metadata": {
"type": "SP.List"
},
"Title": "<new list name>"
}
Note: <…> are placeholders, replace them including the < and >. Check this blog post if the HTTP returns ‘List does not exist’ error.
Renaming multiple lists / libraries at once
The HTTP request above will rename one list. If you’d like to rename multiple lists in the same flow, you shouldn’t do it by adding an HTTP request for each list. It’s much better to use a configuration list similar to the one used for copying files between libraries and take the information from there. A simple SharePoint list with 3 columns for the 3 pieces of information.
Once you have all the information in the list you can get all the rows and use them in the HTTP request. The flow below will take all the lists in the configuration and rename then one by one.
Summary
As already mentioned in the post on copying pages between SharePoint sites, flows are not limited to repeated tasks. You can build a simple Power Automate flow also for one time tasks, e.g. to rename SharePoint list(s). And even though there’s no action to do that, there’s always an HTTP request that’ll do the task.
Hello, thanks for the tutorial worked for me.
But i hvae a problem, the list name does only change for me when I share this list other people still se the original name from when the list was created.
Is there something I can do to change this ?
Hello Marius,
did they try to fully refresh the browser tab? The request should rename it for everyone, but I can imagine that if they used a different language in SharePoint than you do it could change it only for your language.
Hello,
yes the site gets refreshed everytime. I tested it myself with another account, diffrent browser, delted cache and cookies. I changed the timezone of the list so its matches our timezone. Its very wierd and i dont know how I can fix this.
One question, the url shuld not chnage with this method or ? Because i just change the list name but not its “id” ?
Hello Marius,
it’ll change only the list name, the list URL and ID are assigned when the list is created and it stays the same.
For the issue I don’t have any more ideas, using different languages for the SharePoint site was the only one.
Thanks Tom,
This was exactly what I was looking for. I appreciate you sharing your knowledge.
robertg