View Formatting - JSON - Not able to get attachments in list

Iron Contributor

Hi,

 

I'm using JSON to customize my list, and trying to get the values from my Attachments in the list, but not working as expected.

 

In the following URL: https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/column-formatting#foreach it states the following: "The field used in the loop must be in a supported field type with multi-value option enabled: Person, Lookup, and Choice.".

 

So not sure if the attachments is just not an option using JSON and Column/View Formatting?

 

I've tried to get the length of the Attachments field, but always comes back with 0, even though there are attachments. I've also ensured that the Attachments column is part of the view.

 

Looked through numerous examples on the web, but can't find any reference to attachments.

 

This is a show stopper for a project we are currently working on, so hopefully there's a solution :)

 

Some of the sites I've already looked through (and a bunch more not listed)

https://techcommunity.microsoft.com/t5/Microsoft-SharePoint-Blog/Building-immersive-user-experiences...

https://jeffangama.wordpress.com/2018/09/09/sharepoint-view-formatting-options/

https://jeffangama.wordpress.com/2017/12/03/sharepoint-online-column-formatting-options/

https://docs.microsoft.com/en-us/sharepoint/dev/declarative-customization/view-formatting

 

Thanks,

 

Grant.

8 Replies

@gjen020 I doubt whether the attachment column is supported

@Maruthi Gadde

 

Thanks for your reply. Would be good for someone from Microsoft to confirm this. Really hard to find information about what's supported and what's not.

 

If we can't do this, then will have to re-think our current solution. Feels like we are continuously doing this with the Office 365 suite - get 90% of the way there only to find out that something can't be done which means re-engineering the solution :(

 

Not complaining - understand that a lot of the apps/services are fairly new and maturing, just a bit frustrating at times :)

 

Cheers,

 

Grant.

I'm also exploring attachements in lists. I find out that [$Attachments] is a boolean that displays 0 if there are no attachements and 1 if there are some.

@KM KTNN Yup, the Attachments field returns "1" or "0". It will not be possible to get the length for the number of attachments.

@Beau CameronDo you know if we could use the array AttachmentFiles ?

@KM KTNN Unfortunately this is not available in Column Formatting.

@KM KTNN  While Column formatting may  not  work here you could consider Flow to run, get the attachments url and update it to a temporary column. .

 

see if this helps https://maruthigadde.com/2019/07/26/display-sharepoint-online-list-attachments-files-within-the-list...  

Hi, please help to vote the idea your brought up to make Microsoft work harder for us. Thanks https://feedbackportal.microsoft.com/feedback/idea/c290f4f2-46cf-ec11-a81b-000d3a00c008