Microsoft List- How to format a row to show that it is "Due"

Limon, Annabel 0 Reputation points
2026-09-02T17:45:50.1066667+00:00

I need an item to turn red once the date column is 6 months out. This will show it is "Due" but won't change the date in the column. Just change the color.

Microsoft 365 and Office | SharePoint | For business | Other
0 comments No comments

2 answers

Sort by: Newest
  1. Jay1 Tran 600 Reputation points Independent Advisor
    2026-09-02T18:10:38.22+00:00

    Hi Annabel,

    Thank you for reaching out.

    You can use SharePoint column formatting to make the Due Date column display with a red background when the date is within six months. This formatting only changes the appearance of the column. It will not modify the stored date.

    Please follow these steps:

    1. Open the SharePoint list.
    2. Select the Due Date column heading.
    3. Select Column settings.
    4. Select Format this column.

    User's image

    1. At the bottom of the formatting pane, select Advanced mode.

    User's image

    1. Remove any existing JSON and paste the following:
    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
      "elmType": "div",
      "style": {
        "background-color": "=if(@currentField == '', '', if(@currentField <= @now + 15811200000, '#d13438', ''))",
        "color": "=if(@currentField == '', '', if(@currentField <= @now + 15811200000, 'white', ''))",
        "font-weight": "=if(@currentField == '', '', if(@currentField <= @now + 15811200000, '600', 'normal'))",
        "padding": "4px 8px",
        "border-radius": "4px"
      },
      "txtContent": "@currentField.displayValue" } 
    
    
    1. Select Save.

    The Due Date cell will now have a red background and white text when the date is due within approximately six months. Past-due dates will remain red as well. Blank date cells will not be formatted.

    User's image I hope this information is helpful. Please try these steps and let me know how it goes. Should you have any further questions, please feel free to reach out and let me know. I'll be happy to help.

    Thank you for your time and cooperation.

    Was this answer helpful?


  2. AI answer

    2026-09-02T17:46:04.33+00:00

    Use view formatting if the whole row should turn red, or column formatting if only the date cell should turn red.

    For the entire row, in the list:

    1. Select All items or Switch view options.
    2. Select Format current view.
    3. Select Advanced mode.
    4. Paste this JSON and save:
    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
      "additionalRowClass": "=if([$DueDate] <= @now + 15768000000, 'sp-field-severity--severeWarning', '')"
    }
    

    This applies a red warning style when the item date is within 6 months from now or earlier. Replace DueDate with the internal name of the date column if the column has a different name. If the column name contains spaces, use the internal-name format such as Due_x0020_Date.

    For only the date column, use Column settings > Format this column > Advanced mode and paste:

    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
      "elmType": "div",
      "txtContent": "@currentField",
      "style": {
        "background-color": "=if([$DueDate] <= @now + 15768000000, '#ff0000', '')",
        "color": "=if([$DueDate] <= @now + 15768000000, 'white', '')"
      }
    }
    

    Notes:

    • @now is the current date/time when the list view loads.
    • SharePoint formatting supports date math by adding milliseconds to a date. Six months is approximated here as 15768000000 milliseconds.
    • This changes only the display color, not the stored date value.

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.