Forum Discussion

misce's avatar
misce
Copper Contributor
Aug 13, 2020
Solved

Conditional Format SharePoint List Due Dates with three conditions - RAG

I've tried searching for this seemingly everywhere and although there's lots of people with similar problems I've not found someone with this exact one and therefore this answer. Apologies if it is a...
  • TKLR_83's avatar
    Mar 24, 2021

    misce I was recently looking for a similar resource myself. If you are still in need, this code should work for you. If you don't like the exact RAG colors, you can easily replace the them with a different HEX (here is a great site for picking colors: Color Picker Tool - Hex Colors)

     

    {
        "elmType""div",
        "txtContent""@currentField",
        "style": {
            "background-color""=if(Number(@currentField) == 0, '', if(@currentField >= @now + 2592000000, '#AFF8C9', if(@currentField >= @now + 86400000, '#EEBB2F', if(@currentField <= @now, '#F06C47',''))))"
        }
    }

Resources