Show a button on List View only on condition

%3CLINGO-SUB%20id%3D%22lingo-sub-1228838%22%20slang%3D%22en-US%22%3EShow%20a%20button%20on%20List%20View%20only%20on%20condition%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1228838%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20everyone%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20using%20JSON%20to%20change%20the%20list%20view%2C%20i%20would%20like%20to%20improve%20my%20code%20to%20show%20a%20button%20(called%20%22En%20savoir%20plus%22)%20only%20when%20there%20is%20an%20attachment%20to%20the%20list%20item%20but%20i%20don't%20find%20the%20right%20operator.%3C%2FP%3E%3CP%3EAnyone%20can%20help%20me%20%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20my%20code%20%3A%26nbsp%3B%3C%2FP%3E%3CP%3E%7B%3CBR%20%2F%3E%22schema%22%3A%20%22%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fview-formatting.schema.json%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fview-formatting.schema.json%3C%2FA%3E%22%2C%3CBR%20%2F%3E%22hideSelection%22%3A%20true%2C%3CBR%20%2F%3E%22hideColumnHeader%22%3A%20true%2C%3CBR%20%2F%3E%22rowFormatter%22%3A%20%7B%3CBR%20%2F%3E%22elmType%22%3A%20%22div%22%2C%3CBR%20%2F%3E%22attributes%22%3A%20%7B%3CBR%20%2F%3E%22class%22%3A%20%22sp-row-card%22%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%22children%22%3A%20%5B%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22elmType%22%3A%20%22div%22%2C%3CBR%20%2F%3E%22style%22%3A%20%7B%3CBR%20%2F%3E%22text-align%22%3A%20%22left%22%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%22children%22%3A%20%5B%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22elmType%22%3A%20%22div%22%2C%3CBR%20%2F%3E%22attributes%22%3A%20%7B%3CBR%20%2F%3E%22class%22%3A%20%22sp-row-title%22%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%22txtContent%22%3A%20%22%5B%24Title%5D%22%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22elmType%22%3A%20%22div%22%2C%3CBR%20%2F%3E%22attributes%22%3A%20%7B%3CBR%20%2F%3E%22class%22%3A%20%22sp-row-listPadding%22%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%22txtContent%22%3A%20%22%5B%24R_x00e9_ponse%5D%22%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%7B%3CBR%20%2F%3E%22elmType%22%3A%20%22button%22%2C%3CBR%20%2F%3E%22customRowAction%22%3A%20%7B%3CBR%20%2F%3E%22action%22%3A%20%22defaultClick%22%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%22txtContent%22%3A%20%22En%20savoir%20plus%22%2C%3CBR%20%2F%3E%22attributes%22%3A%20%7B%3CBR%20%2F%3E%22class%22%3A%20%22sp-row-button%22%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%5D%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%7D%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1228838%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDeveloper%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
New 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"
}
}
]
}
]
}
}

0 Replies