Forum Discussion
chhe5
Mar 28, 2020Copper Contributor
Format list view => icon if attachment
Hello,
I have formatted a sharepoint list with JSON. Now I want to show up an icon if there is an attachment attached to the item. I have tried this:
"children": [
{
"elmType": "span",
"style": {},
"attributes": {
"iconName": "=if([$Attachments] == '1', 'Attach', 'FieldEmpty')",
}
},
]
If I fill in this code into my whole JSON Code, then all my items dissapear and the list is empty.
What am I doing wrong?
Can someone help me please?
Greetings from Germany.
Greetings from Germany.
- Sudharsan KSteel ContributorHi,
If you just want to show an icon, why dont you use the inbuilt attachment column which does the same. Is there any other feature you are trying to built based on the icon?- chhe5Copper Contributor
Hi,
my problem is that I dont know how I can read out the attachments column. If I use
"txtContent": "[$Attachments]"
nothing happens. Is that the right internal name for the Attachment list? And I want to show how many Attachments are behind a list item.