In my Sharepoint Online list I have a column formatted as multiple checkbox selection. It works as it should, when I click on some checkbox it is showed on the list. However, I would like to have a different situation here: All unselected items are showed by default on the list and selecting its checkbox making that items disappear from the list. So it would work king opposite how it is by default. Is that possible? Can it be achieved with Json formatting?
1 Answer
You can use the multi-choice-icons.json script to implement your design.
1.Create a Choice(Checkboxes) Column

2.Formatting Multi-Select Values in List Formatting
/* multi-choice-icons.json */
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"style": {
"font-size": "16px"
},
"children": [
{
"elmType": "span",
"attributes": {
"title": "Choice1",
"iconName": "Precipitation",
"class": "='ms-fontColor-' + if(indexOf(join(@currentField,''),'Choice1') != -1, 'themeDark', 'neutralLight')"
},
"style": {
"padding": "0 3px"
}
},
{
"elmType": "span",
"attributes": {
"title": "Choice2",
"iconName": "CoffeeScript",
"class": "='ms-fontColor-' + if(indexOf(join(@currentField,''),'Choice2') != -1, 'themeDark', 'neutralLight')"
},
"style": {
"padding": "0 3px"
}
},
{
"elmType": "span",
"attributes": {
"title": "Choice3",
"iconName": "Wines",
"class": "='ms-fontColor-' + if(indexOf(join(@currentField,''),'Choice3') != -1, 'themeDark', 'neutralLight')"
},
"style": {
"padding": "0 3px"
}
},
{
"elmType": "span",
"attributes": {
"title": "Choice4",
"iconName": "BeerMug",
"class": "='ms-fontColor-' + if(indexOf(join(@currentField,''),'Choice4') != -1, 'themeDark', 'neutralLight')"
},
"style": {
"padding": "0 3px"
}
},
{
"elmType": "span",
"attributes": {
"title": "Choice5",
"iconName": "TestBeaker",
"class": "='ms-fontColor-' + if(indexOf(join(@currentField,''),'Choice5') != -1, 'themeDark', 'neutralLight')"
},
"style": {
"padding": "0 3px"
}
}
]
}

