Quantcast
Channel: Ryan Clark, Author at Mr. SharePoint
Viewing all articles
Browse latest Browse all 256

How to Create Colored Folders in SharePoint and OneDrive

$
0
0

Want to create those shiny colorful folders?

In this guide, I will show you how to easily create colored folders (and change their colors) in both SharePoint and OneDrive.

Let’s get started!

How to Create Colored Folders

You may have seen the changes in the last quarter of 2023 where there’s an additional option when creating folders.

That’s because the rollout for folder colors in SharePoint and OneDrive started in August 2023, as you can see here.

The good part is that it’s really easy to create these colored folders. 🙂

Related: SharePoint Library vs Folder: Stay Away From Folders

1. SharePoint Online

Basically, you simply have to create a folder the normal way:

create a new folder within the document library

From here, you simply need to click the color you want to apply to the new folder.

After clicking the create button, you will then see the new colored folder:

create a green colored folder in sharepoint

Easy, right? 😎

Related: How to Create a Password-Protected Folder in SharePoint

2. OneDrive

The steps are the same in OneDrive:

  • Go to where you want to create a new folder
  • Click the add new button > folder option
add a new folder in onedrive

Name it and then:

  • Select the folder color
  • Click the create button
create a red colored folder in onedrive

No differences at all with the steps in SharePoint Online. 🙂

How to Change the Colors of the Folders

But can you change the color of a pre-existing folder?

Yes! You can change the color of existing folders even the ones created even before the colored folders update rolled out.

Bring out the context menu of the target folder by either of the following options:

  • Right-click the folder (simplest)
  • Click the vertical ellipsis

From the choices, go to folder color > select the color you want to apply:

change the color of the folder in sharepoint

Right after you click on the color, the change will take effect immediately.

By the way, the same steps apply when changing the color of a folder in OneDrive.

Using Powershell to Create Colored Folders

Powershell can do a lot of things, and even more than what the front user interface can achieve.

If you want to use Powershell for this, you can use the following script:

# Set Variables 
$siteUrl = "https://yourtenanthere.sharepoint.com/sites/sitenamehere"
$documentLibrary = "nameoflibrary"
$folderName = "nameoffolder" 
$folderColor = 3

try {
    # Connect to SharePoint site
    Connect-PnPOnline -Url $siteUrl -Interactive -ErrorAction Stop

    # Create the folder
    $newFolder = Add-PnPFolder -Name $folderName -Folder $documentLibrary -ErrorAction Stop

    # Get the created folder item
    $newFolderItem = Get-PnPListItem -List $documentLibrary -UniqueId $newFolder.UniqueId -ErrorAction Stop

    # Change the value of the _ColorHex column of the created folder to change the color
    Set-PnPListItem -List $documentLibrary -Identity $newFolderItem.Id -Values @{"_ColorHex" = $folderColor } -ErrorAction Stop

    Write-Host "Folder created and color changed successfully." -ForegroundColor Green
    Write-Host "Folder URL: $siteUrl/$documentLibrary/$folderName" -ForegroundColor Green
}
catch {
    Write-Host "An error occurred: $_" -ForegroundColor Red 
}
finally {
    # Disconnect from SharePoint site
    Disconnect-PnPOnline
}

For the folder color numbers, you can refer to the following table:

Color Hex ValueColor
Empty or 0Yellow (default)
1Dark red
2Dark orange
3Dark green
4Dark teal
5Dark blue
6Dark purple
7Dark pink
8Grey
9Light red
10Light orange
11Light green
12Light teal
13Light blue
14Light purple
15Light pink

Got any questions about creating colored folders in SharePoint Online and OneDrive? Leave a comment.

For any business-related queries or concerns, contact me through the contact form. I will reply asap. 🙂

The post How to Create Colored Folders in SharePoint and OneDrive appeared first on Mr. SharePoint.


Viewing all articles
Browse latest Browse all 256

Trending Articles