How to show names of attachments from a list item in a column?
-
10-12-2019 - |
Question
I have an announcements list and some announcements have multiple attachments. The view is set to show the attachments, but it just shows this paperclip icon which probably means the list item has attachments.
What I need to achieve, is to show the name of the attachments of the list items in an extra column (if possible, on a multiline text field). How would I achieve this?
I found this site that has an answer but it is for SP2010, I am working in SP2013 and I can't use this. :( Anything that can be done with SP Designer 2013 would be awesome.
Solution
You have 2 ways to do it.
One is create a hidden field in the list named Attachments, and with the help of event receiver, set it when attachment added, updated, deleted. So, now you have the attachment names (if needed add them as links, for this the column must be of type multi line text box (rich text field)).
Second and easiest way is the modifications using SharePoint Designer. Just follow this steps mentioned at: http://amitphule.blogspot.in/2012/04/display-item-attachments-in-sharepoint.html
Let me know if you need any additional help.
OTHER TIPS
I assume you have already found a solution for your issue. I was also struggling with the issue similar to yours. Could not get "List view tools" for my view. That was resolved after I checked "Server Render" option in Web Part properties-Miscellaneous section. However, I found an easy workaround by using jslink and jquery. Please refer to this source.
I got round this issue by using Infopath Designer to inject the URL into a "simple line of text" field.
The steps were as follows.
- create a "single line of text" field in your list. I called mine "AttachmentURL"
Load infopath designer. and load your SharePoint list
Right click on the "single line of text" field "AttachmentURL" and select "Text box properties"
- In the "Default Value" section next to "Value", click the "Fx" button
- In the "Formula" dialog box, select the "Insert Field or Group" button
- In "Advanced view", expand the "Attachments" folder, and select the ":attachmentURL" icon and click "OK" all the way back to your form
- After making any other alterations in your form, publish the form to the SharePoint list
This gave me the attachment filename. I then used SharePoint Designer to build the rest of the URL :
Open SharePoint Designer and go to your list workflow
You will now be able to build the Attachment's URL by creating a hyperlink that follows this construction :
https://site/Forms/Lists/LISTNAME/Attachments/ID/AttachmentURL
I had no issue creating the attachment URL in a designer workflow with this method. You can then push the full URL to another field if you like, or email it with the workflow.