Sharepoint List Conditional formatting for Due Date column

Ben 0 Reputation points
2024-09-24T23:31:31.9433333+00:00

I want to conditionally format a Due date column in sharepoint lists.

The idea is for it to Turn red letters once the original date entered is past. I tried the conditional formatting but didint work or doing it wrong But the date entered is a future date when the item is due. If that day is pasted then it should be red.

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,740 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AllenXu-MSFT 20,666 Reputation points Microsoft Vendor
    2024-09-25T05:33:34.53+00:00

    Hi @Ben,

    You can use below JSON code to format your due date column.

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

    User's image

    Or apply conditional formatting rule like below.

    User's image

    Make sure the "duedate" column is a date and time column type.


    If the answer is helpful, please click "Accept as Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

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