Overdue Flag
Overview
- Compares a due or SLA date against today and flags it automatically, with no manual status to keep updated
- Items past their date show a red Overdue flag; items due within three days show an amber Due soon flag
- The date is shown bold and the flags sit in bright high-contrast pills, all on a fixed width so the column lines up
- On-track and future items show the date plainly, and blank dates show a neutral dash
- Uses the current column and the current date, so it re-evaluates every day on its own
- Pure column-formatting JSON, so nothing about the underlying data changes
Common Use Cases
- Task and project due dates
- Support ticket SLA deadlines
- Contract and license renewals
- Invoice and payment due dates
- Compliance and review deadlines
- Action item and follow-up tracking
Details
- Design Pattern: Status & Indicator Badges
- Format Scope: Column
Required Columns
| Display name | Column type | Internal name |
|---|---|---|
| Title | Single line of text | [Title] |
| Due Date | Date and time | [Due Date] |
| Assigned To | Person or Group | [Assigned To] |
| Status | Choice | [Status] |
Prerequisites
- Build a list with these columns before you paste the JSON.
- Populate the list with data.
- Because the JSON is applied at the column level, the Due Date column can use any name you want.
- Items past their date are flagged Overdue and items due within three days are flagged Due soon – change the three-day window (259200000 milliseconds) in the JSON to match your own SLA.
How to Apply JSON code
- On the Due Date column, open the column header menu, choose Column settings, then Format this column.
- Switch to Advanced mode.
- Paste the JSON below and click Save.
JSON Code
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "div",
"style": {
"display": "inline-flex",
"align-items": "center",
"min-height": "36px",
"padding": "4px 0",
"gap": "14px",
"white-space": "nowrap"
},
"children": [
{
"elmType": "span",
"style": {
"font-size": "15px",
"font-weight": "700",
"line-height": "20px",
"color": "=if(@currentField == '', '#a19f9d', if(floor(Number(Date(@currentField)) / 86400000) < floor(Number(Date(@now)) / 86400000), '#a4262c', if((floor(Number(Date(@currentField)) / 86400000) - floor(Number(Date(@now)) / 86400000)) <= 3, '#8a6d00', '#323130')))"
},
"txtContent": "=if(@currentField == '', '-', toLocaleDateString(@currentField))"
},
{
"elmType": "span",
"style": {
"display": "=if(@currentField == '', 'none', if(floor(Number(Date(@currentField)) / 86400000) < floor(Number(Date(@now)) / 86400000), 'inline-flex', if((floor(Number(Date(@currentField)) / 86400000) - floor(Number(Date(@now)) / 86400000)) <= 3, 'inline-flex', 'none')))",
"align-items": "center",
"justify-content": "center",
"padding": "3px 11px 3px 8px",
"border-radius": "10px",
"font-size": "11px",
"font-weight": "600",
"line-height": "14px",
"color": "#1b1b1b",
"background-color": "=if(floor(Number(Date(@currentField)) / 86400000) < floor(Number(Date(@now)) / 86400000), '#ff8a8a', '#ffd24d')"
},
"children": [
{
"elmType": "span",
"attributes": {
"iconName": "=if(floor(Number(Date(@currentField)) / 86400000) < floor(Number(Date(@now)) / 86400000), 'Flag', 'Clock')"
},
"style": {
"margin-right": "5px",
"font-size": "12px",
"line-height": "12px"
}
},
{
"elmType": "span",
"txtContent": "=if(floor(Number(Date(@currentField)) / 86400000) < floor(Number(Date(@now)) / 86400000), 'Overdue', 'Due soon')"
}
]
}
]
}
Common Questions About the Overdue Flag
What is the Overdue Flag built with?
It is built with a standard Microsoft List (SharePoint list) and a small piece of column-formatting JSON applied to the date column. There is no custom development, no SPFx solution, and no third-party tools. It is the kind of clean, maintainable formatting Greg Zelfond builds for teams that want a polished list without ongoing development overhead.
What kind of column does it need?
It works on any Date column – a Due Date, SLA date, renewal date, or deadline. Because the JSON reads the current column and compares it to today, you can reuse it on any date field, and the column name does not need to match anything.
Does this design use any custom development or third-party tools?
No. It uses only out-of-the-box SharePoint column formatting, which Microsoft supports natively. That keeps it stable and easy to maintain, and nothing breaks when SharePoint is updated. Out-of-the-box is the only way Greg builds, so you can own and extend the design yourself for years.
If LookBook 365 is code-free and out-of-the-box, why does this example include JSON?
Because SharePoint formatting JSON is not custom code – it is a native configuration feature built into lists and libraries. It is declarative: it only describes how existing columns and views look, and cannot run scripts, reach external services, or change your data. Nothing is deployed and nothing breaks when Microsoft updates SharePoint, and you can edit or remove it anytime. That is why LookBook 365 treats it as out-of-the-box and low risk.
How does it decide what is overdue?
It compares the date in the column to today’s date each time the list is opened. Anything earlier than today is flagged Overdue in red, anything due within the next three days is flagged Due soon in amber, and everything further out shows the date plainly. Because it reads the current date every time, the flags update on their own every day.
Can Greg build formatting like this for our lists?
Yes – this is exactly the kind of work Greg Zelfond does. As an independent SharePoint consultant and Microsoft MVP, he designs out-of-the-box list and library formatting like this so your team can read and maintain it without a developer. Reach out through the contact page to talk about your lists.
