Others

Apply SharePoint Row Colors Based on People Column Counts

John WilsonJohn Wilson Nov 3, 2026 868 views

Question details

The user wants to conditionally change the background color of SharePoint list rows or cells depending on the number of users selected in a multi-select People and Groups column.

Apply SharePoint Row Colors Based on People Column Counts
Product
SharePoint
Device & OS
not provided
Scenario
Customizing a SharePoint list view to provide visual indicators based on how many users are assigned to an item, without utilizing Power Apps.
Observed behavior
The user needs to count the users in a People column to trigger background color changes (e.g., yellow for fewer than two users, green for two or more) using native SharePoint JSON formatting and Power Automate workflows.
Before you start

Ensure you have list management permissions in SharePoint to format views and sufficient access to Power Automate to create and manage cloud flows.

Solution 1Recommended

Use Power Automate to Count Users and Apply JSON View Formatting

Since SharePoint JSON formatting cannot directly count array lengths, you can use a Power Automate flow to extract the user count into a helper column, and then base your JSON row formatting on that helper column.

SharePoint list formatting relies on the values directly available in the list view. A multi-select People and Groups column is treated as an array, but JSON view formatting does not have a built-in function to count the number of elements in an array. To solve this, you must calculate the count automatically via a flow and store it in a standard number column.

1
Create a Helper Column

Navigate to your SharePoint list and add a new Number column (e.g., named 'PersonNumber'). This column will hold the count of the users selected.

2
Create a Power Automate Flow

Open Power Automate and create an automated cloud flow that triggers 'When an item is created or modified' targeting your SharePoint list.

3
Calculate the User Count

Add an 'Update item' action. For the 'PersonNumber' field, use a flow expression like length(triggerOutputs()?['body/YourPeopleColumnName']) to calculate how many users are selected in the People column.

4
Open SharePoint View Formatting

Return to your SharePoint list, click the view dropdown menu in the top right corner, select 'Format current view', and choose 'Advanced mode'.

5
Apply JSON Conditional Formatting

Paste your custom JSON code to style the row. Use conditions based on the 'PersonNumber' column, setting the background color to yellow when the value is less than 2, and green when it is greater than or equal to 2. Save the view.

Use Power Automate to Count Users and Apply JSON View Formatting
Alternative Cell Formatting: If you only want to change the color of a specific cell instead of the entire row, select 'Format this column' on the specific column header instead of formatting the current view.
Free Microsoft Office alternative

Boost Your Productivity with WPS Office

While you use SharePoint and Power Automate for complex web-based list management, WPS Office is the perfect solution for your daily desktop document needs. It provides a lightweight, fast, and feature-rich environment to manage documents, spreadsheets, and presentations.

  1. 1. Download the Installer: Visit the official WPS Office website and download the free installation package for your operating system.
  2. 2. Install the Software: Run the installer and follow the quick on-screen setup instructions.
  3. 3. Open Your Files: Launch WPS Office and directly open your existing Microsoft Office documents without worrying about format conversion or data loss.
Seamlessly compatible with Microsoft Office formats including Word (.docx), Excel (.xlsx), and PowerPoint (.pptx).Free to use with a highly familiar and intuitive tabbed user interface.Lightweight application that requires minimal system resources and runs incredibly fast.Built-in advanced PDF editing, converting, and merging capabilities at your fingertips.
microsoft office alternative - wps office

Frequently Asked Questions

Can I count people in a SharePoint column using only JSON formatting?

No, SharePoint JSON formatting does not currently have a function to evaluate the length or count of elements inside an array-type column, such as a multi-select People and Groups column. You must use a workaround like Power Automate to count the items first.

Do I need Power Apps to customize row colors in SharePoint?

No, Power Apps is not required for simple visual modifications. You can natively customize row and column colors using SharePoint's out-of-the-box JSON view formatting capabilities.

Why isn't my Power Automate flow updating the number column correctly?

Ensure your flow triggers on both item creation and modification. Also, verify that your length() expression correctly targets the internal name of the People column array and includes conditions to handle null values in case the column is left entirely blank.

Can I apply the color rules to just one cell instead of the whole row?

Yes. By choosing 'Format this column' from the column's dropdown menu instead of 'Format current view', you can apply your JSON conditional formatting strictly to the individual cell's background.