Created
April 22, 2022 17:09
-
-
Save thechriskent/e8111cb428053ab40dbee849f5debcd0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json", | |
"elmType": "div", | |
"style": { | |
"display": "=if(@currentField,'flex','none')", | |
"flex-wrap": "wrap", | |
"width": "100%" | |
}, | |
"children": [ | |
{ | |
"elmType": "div", | |
"style": { | |
"margin": "5px", | |
"padding": "5px 10px 5px 10px", | |
"border-radius": "10px" | |
}, | |
"attributes": { | |
"class": "ms-bgColor-themePrimary" | |
}, | |
"children": [ | |
{ | |
"elmType": "div", | |
"style": { | |
"vertical-align": "middle", | |
"white-space": "nowrap", | |
"width": "auto" | |
}, | |
"attributes": { | |
"class": "ms-fontColor-white ms-font-s" | |
}, | |
"children": [ | |
{ | |
"elmType": "span", | |
"style": { | |
"position": "relative", | |
"top": "2px" | |
}, | |
"attributes": { | |
"iconName": "=if(@currentField=='Elephant','Cat','Tag')" | |
} | |
}, | |
{ | |
"elmType": "span", | |
"style": { | |
"padding-left": "5px" | |
}, | |
"txtContent": "@currentField" | |
} | |
] | |
} | |
] | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment