3

This code works but rather than display the words "true" or "false" I want it return "yes" or "no" based on what is in @currentField.

{
 "$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"txtContent": "@currentField",
"style": {
    "color": {
        "operator": "?",
        "operands": [
            {
            "operator": "<=",
            "operands": [
                "[$Handouts_x0020_Complete]",
                0
            ]
            },
            "red",
            ""
        ]
    }
}
}
1

You could try changing

"txtContent": "@currentField", 

to use an excel style expression like

"txtContent": "=if(@currentField == 1, 'yes', 'no') ",

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.