Sharepoint - Get URL of list item attachment from Sharepoint Designer 2010
I got round this issue by using Infopath Designer to inject the filename into a "single line of text" field that my workflow could target.
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 (I used rules to hide the AttachementsURL in the form)
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
which will look like this in your workflow string builder :
https://site/Forms/Lists/LISTNAME/Attachments/[%CurrentItem:ID%]/[%CurrentItem:AttachmentURL%]
I had no issue posting the attachment URL in a designer workflow email with this method.
I must point out, that with this method, only the 1st attachment link will be shown in the output. Any subsequent attachment links will not be displayed.
It seems it is not doable. See https://social.msdn.microsoft.com/Forums/en-US/22ddd28d-d074-49ac-9044-074ceb155ffb/how-to-get-attachment-url-in-sharepoint-designer.
You can write a custom sandboxed workflow action to item's Attachment URL
.