Show a button on List View only on condition

Copper Contributor

Hello everyone,

 

I'm using JSON to change the list view, i would like to improve my code to show a button (called "En savoir plus") only when there is an attachment to the list item but i don't find the right operator.

Anyone can help me ? 

 

Here is my code : 

{
"schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"hideSelection": true,
"hideColumnHeader": true,
"rowFormatter": {
"elmType": "div",
"attributes": {
"class": "sp-row-card"
},
"children": [
{
"elmType": "div",
"style": {
"text-align": "left"
},
"children": [
{
"elmType": "div",
"attributes": {
"class": "sp-row-title"
},
"txtContent": "[$Title]"
},
{
"elmType": "div",
"attributes": {
"class": "sp-row-listPadding"
},
"txtContent": "[$R_x00e9_ponse]"
},
{
"elmType": "button",
"customRowAction": {
"action": "defaultClick"
},
"txtContent": "En savoir plus",
"attributes": {
"class": "sp-row-button"
}
}
]
}
]
}
}

1 Reply