logo
search
Others

How to Automatically Highlight Microsoft Lists Rows by Due Date

Steve KSteve K Sep 27, 2026 869 views

Question details

The user wants to dynamically format and highlight entire rows in Microsoft Lists when a task's due date is today or has already passed.

How to Automatically Highlight Microsoft Lists Rows by Due Date
Product
Microsoft Lists
Device & OS
not provided
Scenario
Tracking project deadlines or task due dates where overdue or urgent items need to stand out visually using list view formatting.
Observed behavior
Rows remain unformatted until custom JSON code is applied to the list's view settings to compare the date column to the current date.
Before you start

Ensure your due date column is strictly set to the 'Date and Time' type. You must also know the exact internal name of this column (which may differ from its display name) for the formatting code to work.

Solution 1Recommended

Use JSON View Formatting to Highlight Rows

Apply a custom JSON schema to the list's view to dynamically change the background color of rows based on a date comparison.

Microsoft Lists utilizes JSON (JavaScript Object Notation) to customize how rows are displayed. By comparing your date column to the '@now' parameter, you can conditionally apply UI classes like 'ms-bgColor-amber' or 'ms-bgColor-red' to entire rows.

1
Open View Options

Navigate to your Microsoft List. In the top right corner of the command bar, click the View options dropdown menu (this usually displays your current view name, such as 'All Items').

2
Format Current View

Select 'Format current view' from the dropdown menu. In the formatting pane that appears on the right side of the screen, click 'Advanced mode' at the bottom to enable JSON code input.

3
Enter the Formatting Code

Paste your JSON code into the editor. For example: { "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json", "additionalRowClass": "=if([$Due] <= @now, 'ms-bgColor-amber', '')" }. Be sure to replace 'Due' with the actual internal name of your date column.

4
Save and Verify

Click 'Save' and check your list. Rows with a date of today or earlier should now be highlighted with an amber background.

Use JSON View Formatting to Highlight Rows
Adjusting for Past Dates: If you only want to highlight past dates (excluding today), change the operator in your code from '<=' to '< @now'. Note that time-of-day settings might require date normalization if your results are slightly off.
Free Microsoft Office alternative

Track Due Dates Easily Without Code in WPS Office

While Microsoft Lists requires complex JSON coding to highlight due dates, you can effortlessly manage trackers and task lists using intuitive Conditional Formatting in WPS Spreadsheet—no coding required.

Visual Conditional Formatting with an easy-to-use, code-free interfaceFully compatible with Microsoft Excel (.xlsx) formats and formulasLightweight, fast, and completely free to useFamiliar UI makes migrating from Microsoft Office seamless and quick
microsoft office alternative - wps office

Frequently Asked Questions

How do I find the internal name of a column in Microsoft Lists?

Go to the Settings gear icon > List settings. Scroll down to the Columns section and click on your date column. Look at the URL in your browser's address bar; the internal name is the text immediately following 'Field=' at the very end of the URL.

Why is my JSON code highlighting every row instead of just the overdue ones?

This usually happens if the column referenced in the JSON is not formatted as a 'Date and Time' column, or if the internal name is typed incorrectly. Verify the exact internal name and ensure the column type is correct in your List settings.

Can I use different colors for different due date conditions?

Yes. You can nest 'if' statements within the 'additionalRowClass' property to apply different Microsoft UI Fabric color classes (like 'ms-bgColor-red' for overdue and 'ms-bgColor-yellow' for due today) based on multiple date comparisons.