List Text colour formatting (New Experience)

%3CLINGO-SUB%20id%3D%22lingo-sub-284575%22%20slang%3D%22en-US%22%3EList%20Text%20colour%20formatting%20(New%20Experience)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-284575%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20currently%20have%20a%20SP%20List%20(New%20Experience)%20with%202%20simple%20values%20of%20%22Y%22%20%26amp%3B%20%22N%22%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20the%20JSON%20below%20which%20will%20change%20the%20Cell%20BG%20Colour%20to%20what%20i%20state%20but%20I'm%20struggling%20to%20find%20out%20how%20to%20change%20the%20text%20colour%20inside%20that%20Cell%2C%20Ideally%20I%20would%20like%20it%20black%20or%20white%2C%20any%20help%20here%20appreciated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%7B%3CBR%20%2F%3E%22%24schema%22%3A%20%22%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fcolumn-formatting.schema.json%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fcolumn-formatting.schema.json%3C%2FA%3E%22%2C%3CBR%20%2F%3E%22debugMode%22%3A%20true%2C%3CBR%20%2F%3E%22elmType%22%3A%20%22div%22%2C%3CBR%20%2F%3E%22attributes%22%3A%20%7B%3CBR%20%2F%3E%22class%22%3A%20%22%3Dif(%40currentField%20%3D%3D%20'Y'%2C%20'ms-bgColor-yellow'%2C%20if(%40currentField%20%3D%3D%20'N'%2C%20'ms-bgColor-blue'%20''))%22%3CBR%20%2F%3E%7D%7D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Hi All,

 

I currently have a SP List (New Experience) with 2 simple values of "Y" & "N"

 

I have the JSON below which will change the Cell BG Colour to what i state but I'm struggling to find out how to change the text colour inside that Cell, Ideally I would like it black or white, any help here appreciated.

 

{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"debugMode": true,
"elmType": "div",
"attributes": {
"class": "=if(@currentField == 'Y', 'ms-bgColor-yellow', if(@currentField == 'N', 'ms-bgColor-blue' ''))"
}}

 

Thanks

0 Replies