SharePoint Online: How to Change List to Modern Experience?

Requirement: Change the List experience in SharePoint Online.

How to Set SharePoint Online List to New experience?

SharePoint Online’s new list experience provides a faster and easier user interface to lists and libraries. The modern experience is not only fluid and responsive but also adds new enhancements to the user interface of lists and libraries, like column formatting, conditional formatting, quick editing, etc. You can switch between classic & new experiences in SharePoint Online by simply changing the list settings.

To change the list or library to the new modern user interface, do the following:

  1. Go to List or Library settings >> Click on “Advanced Settings”.
  2. Scroll down to the bottom, and from the “List experience” section, Select the “New experience” option and hit OK.
    How to Change SharePoint Online List to New Experience

This changes the list UI to the new experience in SharePoint Online, From:

SharePoint Online Set List to Modern Experience

To: New list experience in SharePoint Online

How about setting the default option for all New Lists?

To set the list experience for new lists, you can specify this option globally using SharePoint Admin Center. Here is how:

  1. Navigate to your SharePoint Admin Center (typically: https://YOURCOMPANY-admin.sharepoint.com/).
  2. Click on “Settings” from the Left navigation >> Click on the “Classic settings page” link at the bottom.
  3. On the setting page, under the “SharePoint list and libraries experience” section, select the appropriate option, such as Classic experience or New experience (auto-detect).

PowerShell to Switch UI experience of a List or Library in SharePoint Online:

On any existing SharePoint Online lists and libraries, you can switch the UI experience using the SharePoint web UI method as explained above or with the PowerShell script below.

#Load SharePoint CSOM Assemblies
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
  
##Variables for Processing
$SiteUrl = "https://crescent.sharepoint.com/sites/sales"
$ListName= "Project Documents"
$UserName="salaudeen@crescent.com"
$Password ="Password goes here"
 
#Setup Credentials to connect
$Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($UserName,(ConvertTo-SecureString $Password -AsPlainText -Force))

Try { 
    #Set up the context
    $Context = New-Object Microsoft.SharePoint.Client.ClientContext($SiteUrl) 
    $Context.Credentials = $credentials

    #Get the document library
    $List = $Context.web.Lists.GetByTitle($ListName)
    #Set list properties
    $List.ListExperienceOptions = "NewExperience" #ClassicExperience or Auto
    $List.Update()

    $context.ExecuteQuery()

    Write-host "UI experience updated for the list!" -ForegroundColor Green        
}
catch {
    write-host "Error: $($_.Exception.Message)" -foregroundcolor Red
}

SharePoint Online new experience not working?
In some cases, even after you change the list experience settings from the list settings, you will still get the same UI. This is because of the browser cookie! Simply clear your browse cookie and reload the page to fix the problem. (To be specific, the cookie is called “spInu” with a value of 0!)

Change List Experience using PnP PowerShell in SharePoint Online

Let’s change the default list experience to “new experience” or “Modern Experience” for a SharePoint Online list.

#Config Variables
$SiteURL = "https://Crescent.sharepoint.com"
$ListName = "Team Documents"

#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Interactive
 
#Set List Experience
Set-PnPList -Identity $ListName -ListExperience NewExperience
To get the List experience settings, use:
Get-PnPList -Identity "List Name" -Includes ListExperienceOptions

Where: 0 = Auto, 1 = modern, 2 = classic

PnP PowerShell to Set List Experience to Modern for All Lists in a Site Collection

Let’s set all lists in a site collection to Modern!

#Variable
$SiteURL ="https://Crescent.sharepoint.com/sites/marketing"
 
#Connect to PnP Online
Connect-PnPOnline -URL $SiteURL -Interactive
 
#Get all the Webs
$Webs = Get-PnPSubWeb -Recurse -IncludeRootWeb
ForEach($Web in $Webs)
{ 
    Write-host "Processing Web:"$Web.URL -f Yellow
     
    #Get All Lists from web and Iterate through
    $Lists = Get-PnPProperty -ClientObject $Web -Property Lists
    ForEach($List in $Lists)
    {
        If($List.ListExperienceOptions -ne "NewExperience" -and ($List.Hidden -eq $false)) 
        {
            #Set List Experience to Modern
            Write-host "`tSetting List Experience to Modern:"$List.Title
            Set-PnPList -Identity $List -ListExperience NewExperience
        }
    }
}

Salaudeen Rajack

Salaudeen Rajack - SharePoint Expert with Two decades of SharePoint Experience. Love to Share my knowledge and experience with the SharePoint community, through real-time articles!

3 thoughts on “SharePoint Online: How to Change List to Modern Experience?

  • I Used the same code with Site Admin Permissions, but its not working

    Reply
  • Why are you using the SiteURL as html syntax and not just the URL? Also I’m getting the following error:
    Exception calling “ExecuteQuery” with “0” argument(s): “The sign-in name or password does not match one in the Microsoft account system.”

    Reply
    • It was caused by a 3rd party plug-in and sorted now. Thanks for notifying, Cheers!

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *