Conditional formatting - only show button if attachments are present

%3CLINGO-SUB%20id%3D%22lingo-sub-2474729%22%20slang%3D%22en-US%22%3EConditional%20formatting%20-%20only%20show%20button%20if%20attachments%20are%20present%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2474729%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20trying%20to%20only%20show%20a%20button%20in%20a%20column%2C%20if%20there%20is%20an%20attachment%20present%20in%20the%20same%20row%20on%20the%20attachment%20column.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere%20is%20what%20I%20have%20so%20far%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%7B%3CBR%20%2F%3E%22%24schema%22%3A%20%22%3CA%20href%3D%22https%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fv2%2Fcolumn-formatting.schema.json%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fv2%2Fcolumn-formatting.schema.json%3C%2FA%3E%22%2C%3CBR%20%2F%3E%22elmType%22%3A%20%22button%22%2C%3CBR%20%2F%3E%22txtContent%22%3A%20%22Send%20Offer%22%2C%3CBR%20%2F%3E%22customRowAction%22%3A%20%7B%3CBR%20%2F%3E%22action%22%3A%20%22executeFlow%22%2C%3CBR%20%2F%3E%22actionParams%22%3A%20%22%7B%5C%22id%5C%22%3A%20%5C%22f191e7c8-1a36-4553-9d64-607764fc6f83%5C%22%7D%22%3CBR%20%2F%3E%7D%2C%3CBR%20%2F%3E%22style%22%3A%20%7B%3CBR%20%2F%3E%22background-color%22%3A%20%22blue%22%2C%3CBR%20%2F%3E%22color%22%3A%20%22white%22%2C%3CBR%20%2F%3E%3CSTRONG%3E%22visibility%22%3A%20%22%3Dif((%5B%24Attachments%5D%20%3D%3D%20false)%2C'visible'%2C'hidden')%22%3C%2FSTRONG%3E%3CBR%20%2F%3E%7D%3CBR%20%2F%3E%7D%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20tried%20changing%20%22%26nbsp%3B%5B%24Attachments%5D%20%3D%3D%20false)%20%22%20to%20equals%20true%2C%201%20and%200%2C%20and%20there's%20still%20no%20use.%20If%20I%20look%20into%20the%20address%20bar%20I%20can%20see%20%22%26nbsp%3BFilterField1%3DAttachments%26amp%3BFilterValue1%3D1%20%22%2C%20but%20even%20when%20I%20enter%20%221%22%20as%20the%20value%20the%20button%20still%20does%20not%20display%20when%20attachments%20are%20present.%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CP%3EAny%20help%20is%20highly%20appreciated.%3C%2FP%3E%3CP%3EThank%20you!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2474729%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EConditional%20Formatting%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFlow%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20List%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Occasional Visitor

Hi,

 

I am trying to only show a button in a column, if there is an attachment present in the same row on the attachment column.

 

Here is what I have so far:

 

{
"$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
"elmType": "button",
"txtContent": "Send Offer",
"customRowAction": {
"action": "executeFlow",
"actionParams": "{\"id\": \"f191e7c8-1a36-4553-9d64-607764fc6f83\"}"
},
"style": {
"background-color": "blue",
"color": "white",
"visibility": "=if(([$Attachments] == false),'visible','hidden')"
}
}

 

I have tried changing " [$Attachments] == false) " to equals true, 1 and 0, and there's still no use. If I look into the address bar I can see " FilterField1=Attachments&FilterValue1=1 ", but even when I enter "1" as the value the button still does not display when attachments are present.

Any help is highly appreciated.

Thank you!

0 Replies