Renamed list cannot be found using the SharePoint List macro

Renamed list cannot be found using the SharePoint List macro

This article is relevant for SharePoint Connector for Confluence Data Center versions 1.12.x and 2.x, which use SharePoint search by title. In versions 3.x and our Cloud version, we use the Microsoft Graph API with IDs, so this issue does not apply.

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 used by the SharePoint List macro to find lists to embed. Renaming a list in SharePoint Online only changes the list title, not the name of the root folder currently used by the SharePoint search index.

To solve this problem, you have to rename the root folder of that list in SharePoint Online. Unfortunately, that is not possible in the SharePoint UI, but there are other ways, such as PowerShell, to do it.

Renaming the root folder will also change the URL to access this library! References containing the old root folder will not work anymore.

Steps to rename the root folder:

  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 is available in the SharePoint search results

Related articles