Advertisements

Replace SharePoint attachment paperclip icons with actual hyperlinked attachment names in list views

You can attach documents to SharePoint list items. However if you add the “Attachments” column to your list views, you get a column that only shows a paperclip icon (see below) if there are any attachments. Clicking that paperclip also won’t open any attachment or the list item to view them. It’s strictly an image.

attachment paperclip

Here’s how you can replace that paperclip on each row with the actual name(s) of your attachment(s) linked to the actual attachment(s).

Download this code, or copy and paste it into a new file in your Site Assets folder as ShowAttachments.js:

When on the list view for which you’re wanting to show attachments, edit the page (settings wheel –> edit page).
chrome_2018-07-20_09-22-11

Add a web part.
chrome_2018-07-20_09-23-09

Add a content editor web part.
chrome_2018-07-20_09-23-35

Paste the URL to the script you saved earlier in the Content Link box.
showattachments

Expand “Appearance” and set Chrome Type to “None” and click OK.
chrome_2018-07-20_09-24-48

Save the page/stop editing.
chrome_2018-07-20_09-25-11

That’s all there is to it!
show attachments

Advertisements

9 Comments

  1. Ryan

    Reply

    I have gotten this to work with the “classic view”. Can you get it to work with the “New Experience” lists?

  2. Paul Dallman

    Reply

    Great solution, but as per Ryan…. Is there a way to get this to work in Modern UI?

      • Paul Dallman

        Reply

        No problem.

        Thanks for the quick response!

        Paul Dallman Applications Manager Union Maritime Limited 7 Portman Mews South, London, W1H 6AY Mobile: +44 7469157994 Email: Paul@unionmaritime.com http://www.unionmaritime.com Union Maritime Limited is a company registered in England and Wales under company number 05674101 and with its registered office at Portland House, 69-71 Wembley Hill Road, Wembley, HA9 8BU, United Kingdom. ​Our privacy policy can be found here. ​

  3. Janice Vardy

    Reply

    Hey.. awesome idea! However I can’t get it to work.. Once added the attachment image disappears, I am not getting the url of the attachment.. any ideas?

  4. Palidhje

    Reply

    The script works great when the Style: is set to Default (classic view, I believe is known as)! However, changing it to style: Basic Tables then it does not show the links … how can we do it so it works on any style view?

  5. Eric Weiner

    Reply

    Great code!

    Is there anyway to force the attachment column to be wider?

      • Eric Weiner

        Reply

        Thanks for the quick response.

        I had already tried that code and it did not work on the “Attachments” column. I also tried to reference the column by its position number in the view and that did not work either. Is there something specific that needs to be done for the “Attachments” column?

        Also when I implemented that resizing code it caused the page to throw an error regarding the page not being secure.

        Thanks for the help.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: