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.

Microsoft 365 and Office | SharePoint | For business | Windows
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. AllenXu-MSFT 24,981 Reputation points Moderator
    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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.