Forum Discussion

Brady27's avatar
Brady27
Copper Contributor
Jun 25, 2022

Microsoft Lists Conditional Formatting Depending on number of days past

My goal is to have the last known date of an event change automatically green if it is 1-7 days past, orange if it is 8-14 days past, and red if it is 15-30 days past.   

1 Reply

  • RobElliott's avatar
    RobElliott
    Silver Contributor

    Brady27 

     

    {
      "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
      "elmType": "div",
      "txtContent": "@currentField",
      "style": {
        "background-color": "=if(@currentField > @now -604800000, 'teal', if(@currentField <@now-604800000 && @currentField > @now-1209600000, 'orange', '#c00000'))",
        "color": "white"
      }
    }

     

     

     

     

    Rob
    Los Gallardos
    Intranet, SharePoint and Power Platform Manager (and classic 1967 Morris Traveller driver)

Resources