Renamed list cannot be found using the SharePoint List macro

Problem

After renaming a library in SharePoint Online it’s not possible to find this library in the edit mode of the SharePoint List macro in Confluence.

Solution

The problem is related to the SharePoint search that is used by the SharePoint List macro to search for lists to embed. Renaming a list in SharePoint Online only changes the title of the list and not the name of the rootfolder that is currently used by the SharePoint search index.

To solve this problem you have to rename the rootfolder of that list in SharePoint Online. Unfortunately that is not possible using the SharePoint UI but there are other ways like Powershell to do that.

Renaming the rootfolder will also result in a changed url to access this library! References containing the old rootfolder will not work anymore.

Steps to rename the rootfolder:

  1. Install the latest release of PnP Powershell on your client

  2. Open the PowerShell ISE

  3. Paste the following script into a new window:

    $siteUrl = "<PASTE THE URL TO YOUR SHAREPOINT SITE THAT CONTAINS THE LIST>" $oldListName = "<PASTE THE OLD NAME OF THE LIBRARY>" $newListName = "<PASTE THE NEW NAME OF THE LIBRARY>" Connect-PnPOnline $siteUrl Rename-PnPFolder -Folder $oldListName -TargetFolderName $newListName

     

  4. Replace the values for siteUrl, oldListName and newListName

  5. Run the script and if prompted enter the credentials of the account you want to use to perform the renaming (the account needs at least edit permissions on the list)

It may take some time until the change will be available in the SharePoint search results