Inputting conditional coding into alternating rows in Lists
Hello,
I am attempting to use both alternating rows and conditional formatting in Microsoft Lists.
The short of it is this;
If [$field_4] is == [$field_6] I want it to code the whole line gray and text red.
Otherwise, I just want it to use alternating rows to make the separated items easily identifiable.
I am not super familiar with coding; so I basically just tried to use a modified version of the code from the conditional JSON, and plug it into the code for alternating rows.
I am not sure what I would need to enter in order to use alternating rows AND the conditional together.
Basically wanting an IF, Then, Else… But I know that those aren’t immediately usable in JSON without writing the logic for it.
Help please? Thanks in advance.
{
“$schema”: “https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json”,
“additionalRowClass”: {
“operator”: “:”,
“operands”: [
{
“operator”: “==”,
“operands”: [
“[$field_4]”,
“[$field_6]”
]
},
“sp-css-backgroundColor-BgLightGray sp-field-fontSizeMedium sp-field-bold sp-css-color-DarkRedText sp-field-borderTopBottomSemibold sp-field-borderTopBottomSolid sp-css-borderTopColor-DarkRedText sp-css-borderBottomColor-DarkRedText”,
“”,
{
“operator”: “==”,
“operands”: [
{
“operator”: “%”,
“operands”: [
“@rowIndex”,
2
]
},
0
]
},
“sp-css-backgroundColor-BgCornflowerBlue40”,
{
“operator”: “:”,
“operands”: [
{
“operator”: “==”,
“operands”: [
{
“operator”: “%”,
“operands”: [
“@rowIndex”,
2
]
},
1
]
},
“sp-css-backgroundColor-noFill”,
“”
]
}
]
}
}
Hello,I am attempting to use both alternating rows and conditional formatting in Microsoft Lists.The short of it is this;If [$field_4] is == [$field_6] I want it to code the whole line gray and text red.Otherwise, I just want it to use alternating rows to make the separated items easily identifiable.I am not super familiar with coding; so I basically just tried to use a modified version of the code from the conditional JSON, and plug it into the code for alternating rows.I am not sure what I would need to enter in order to use alternating rows AND the conditional together.Basically wanting an IF, Then, Else… But I know that those aren’t immediately usable in JSON without writing the logic for it.Help please? Thanks in advance. {
“$schema”: “https://developer.microsoft.com/json-schemas/sp/v2/row-formatting.schema.json”,
“additionalRowClass”: {
“operator”: “:”,
“operands”: [
{
“operator”: “==”,
“operands”: [
“[$field_4]”,
“[$field_6]”
]
},
“sp-css-backgroundColor-BgLightGray sp-field-fontSizeMedium sp-field-bold sp-css-color-DarkRedText sp-field-borderTopBottomSemibold sp-field-borderTopBottomSolid sp-css-borderTopColor-DarkRedText sp-css-borderBottomColor-DarkRedText”,
“”,
{
“operator”: “==”,
“operands”: [
{
“operator”: “%”,
“operands”: [
“@rowIndex”,
2
]
},
0
]
},
“sp-css-backgroundColor-BgCornflowerBlue40”,
{
“operator”: “:”,
“operands”: [
{
“operator”: “==”,
“operands”: [
{
“operator”: “%”,
“operands”: [
“@rowIndex”,
2
]
},
1
]
},
“sp-css-backgroundColor-noFill”,
“”
]
}
]
}
} Read More