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.

  1. create a "single line of text" field in your list. I called mine "AttachmentURL"

Add a single line of text field

  1. Load infopath designer. and load your SharePoint list

  2. Right click on the "single line of text" field "AttachmentURL" and select "Text box properties"

Select text box properties

  1. In the "Default Value" section next to "Value", click the "Fx" button

Fx

  1. In the "Formula" dialog box, select the "Insert Field or Group" button

Insert field or group

  1. In "Advanced view", expand the "Attachments" folder, and select the ":attachmentURL" icon and click "OK" all the way back to your form

Select field or group

  1. 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)

Publish

  1. Open SharePoint Designer and go to your list workflow

  2. 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%]

Create hyperlink in designer

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.

enter image description here


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.