Creating a Colored Folder on SharePoint Online and OneDrive

Yunus Emre Araç
3 min readApr 6, 2024

--

Referance: https://www.yunusemrearac.com/2024/04/06/sharepoint-online-ve-onedrive-uzerinde-renkli-klasor-olusturma/

Hello friends, today I will tell you about a new and colorful update on SharePoint Online and OneDrive :)

As you know, when we set up a folder structure on SharePoint Online and OneDrive, there were either yellow or blue folders depending on the version structure. The color of these folders could not be updated except through script intervention.

But with the latest update, there will be a total of 16 color options initially and you will be able to choose and use any of these colors and change them later.

You do not need to make any updates to use this update.

This feature currently only comes in the library list type on the Sharepoint online side. It is not included in the classic lists.

When you enter a document library on Sharepoint online, we choose to add a new folder by clicking the “Folder” option under the “+ New” button.

When the “Create a folder” popup opens to add a folder, the color catalog will appear at the bottom next to the folder name. You can choose the color you want from here and create the folder in that color.

As you can see above, we can choose a different color for each folder.

It looks colorful and different as you will see in different library view.

When you want to change the color of an existing folder, when you right-click on the folder in the three-dot visual view in the list view, the “Folder color” option will appear in the menu that opens. The selected color will appear here and you can choose the new color from the color chart that opens when you hover over it. In addition, when you click “Rename”, you can update the folder again by opening a pop-up to add a folder.

Connect-PnPOnline -Url $SiteURL -Interactive

$SiteURL = "https://yunusemrearac.sharepoint.com/"
$LibraryURL = "Color Library"
$FolderName = "Grey 2"
$ColorCode = "8"

Connect-PnPOnline -Url $SiteURL -Interactive

$Folder = Add-PnPFolder -Name $FolderName -Folder $LibraryURL

$FolderItem = Get-PnPListItem -List $LibraryName -UniqueId $Folder.UniqueId
Set-PnPListItem -List $LibraryName -Identity $FolderItem.Id -Values @{"_ColorHex" = $ColorCode }

You can create a colored folder with the powershell script using the above powershell code. What you need to pay attention to here is the correct definition of the parameters at the top.

If you are wondering which code to use for which color for the ColorCode parameter, you can use the table below.

Using the methods above, you can categorize your sharepoint libraries and create a colorful layout.

--

--

Yunus Emre Araç
Yunus Emre Araç

Written by Yunus Emre Araç

Technology Product Manager of Corporate Applications at ING | Old Microsoft Student Partners Lead | İnönü Üniv. Bilg. Müh. | İAU Bilg. Müh. Tezli Yüksek Lisans

No responses yet