Setting Attachment URL to a column of the same list item

kkgan
Nintex Employee
Nintex Employee
5 16 9,182

I have a partner asking how to bring the URL of an attachment from a list item to the task form, allowing the approver to click the url to open the attachment. I recalled something I have done before which I haven't got a chance to blog it for sharing. So, here I am trying to extract part of the previously done workflow that is relevant for the objective of the discussed topic - "Assigning the attachment URL to a column of the same list item".

1. In the solution, I have a list with a column named "PictureUrl" (i.e. Single line of text) as shown in below diagram (i.e. this column is what I will need to store the attachment URL).

2. Upon the form saved, a workflow will be triggered to perform series of actions, I am capturing only the main logic here that are relevant to the objective of updating the list item with the attachment Url. The workflow starts with the below actions and its respective configuration as shown in the table followed:

Workflow Action Configuration

3. The workflow is continued with the following actions and its' respective configuration to kick start a loop for updating the URL to the list item properties:

Workflow Action Configuration

4. In the loop, the following action is called to get the attachment Url

Workflow Action Configuration

5. That follows with below actions to assign the URL to the defined "PictureUrl" column

Workflow Action Configuration

Note: Don't worry about the Note and Picture columns here, what we need is just the PictureUrl to be assigned for the purpose of the discussed topic today.

6. Finally, the loop is ended with the following loop related actions

Workflow Action Configuration

That's all we need to get the job done. Hope this helps for those who are looking for the same.

16 Comments
Not applicable

Kok Koon Gan​,

Great post! Do you have a solution for saving attachments during the Task process to the List item in O365? Meaning, if I assign a task to an individual and they want to attach a file, they can do so in the Task form?

The solution can be in the form or the workflow--it doesn't matter to me. I just need to get around saving files to a Task--and not being able to do anything with them.

kkgan
Nintex Employee
Nintex Employee

I have not tried that out, but I think I can point you to the right direction. There is no way you can use the defaulted Sharepoint list attachment control as it is available Sharepoint list form of the same list that is with attachment allowed. But I strongly believe you could use the HTML5 File Upload  <input type="file" id="fileinput" /> . Attachments to a list item is saved in the format of "https://<weburl>/<site>/Lists/<List Name>/<docID>/<file name>", you could then use the File Upload to save attachment(s) to that... Here is the reference and sample shared from technet on how to upload attachment to sharepoint using the REST API and JQuery, the Code example 2 looks like what you will need Upload a file by using the REST API and jQuery

Not applicable

Hi Kok

Unfortunately I couldnt figure out the "build dictionary action " on my nintex workflow components.

Could you please guide me on this ?

mislaila
Nintex Newbie

Hi,

I have same problem with Nitya. What action to use for this in nintex 2013?

Thank you.

kkgan
Nintex Employee
Nintex Employee

The sample is for Nintex for Office 365 workflow actions.... the dictionary i built is for the Call HTTP Web Service, if you are on-prem you will need to look at Web Service i guessed and see what are the value to be supplied there.

kkgan
Nintex Employee
Nintex Employee

see my reply to Nitya... you'll need to look at what is needed for the on-prem Web Request action, i don't have an example for this yet..

Not applicable

Very interesting, I wish I'd found this sooner, as I ended up solving a similar problem a completely different way.

One comment though- the text in your screenshots is really small, I have a lot of trouble reading it. If possible could you make the text larger in later Blogs, I'd like to be able to read what's in here :-}

akrasheninnikov
Process Pupil

Hint @colin_e: the images are clickable!

Not applicable

Yes I know, but I still struggle to read them. The exigencies of age i'm afraid... :-I

akrasheninnikov
Process Pupil

Sorry about that. Have you tried ZoomIt or Magnifier to help with that issue (if you're a PC, not Mac)?

Not applicable

Interestingly, having returned to this post after a few days, the images are larger and easier to read now!?

The issue before was that the text was small AND the images were low-res, so simply zooming them up didn't help much for readability.

Either something changed in the interim, or a few days holiday did wonders for my eyesight 😉

stevena_jhg
Nintex Newbie

does this work for multiple attachments?

kkgan
Nintex Employee
Nintex Employee

Basically per custom list item allows multiple attachments, so I guessed the answer is yes!

Kok Koon Gan (KK) | Technical Evangelist | Mobile: +65 8332 7738 | Office: +65 6407 1059 | @kknintex<https://twitter.com/kknintex> | 8 Marina View Asia Square Tower 1, Level 07-04, Singapore 018960

<https://twitter.com/nintex> <https://www.facebook.com/Nintex> <http://www.linkedin.com/company/nintex> <http://www.youtube.com/nintex>

<https://www.nintex.com/company/events-webinars/events/10-31-2017-nintex-world-tour-singapore>

stevena_jhg
Nintex Newbie

because I am trying to implement something like this to pickup the full url of the each attachment (included file name) and put it either in a separate field or a choice field and then use this to concatenate html into the picture field/fields to show all attachments embed into the form

stevena_jhg
Nintex Newbie

Hi am looking at utilizing a loop to gather results in a dictionary (for attachment urls above), I have an "update list value" action in there but it overwrites it each time it goes through the loop. Is there a way to "Amend" to a list value or should I use a switch action for this?

kkgan
Nintex Employee
Nintex Employee

Thought this should be straight forward to just do something like set field value to field value plus value to append?

Gan Kok Koon (KK) | Nintex<http://www.nintex.com/> – Workflow for Everyone | Technical Evangelist | kokkoon.gan@nintex.com<mailto:kokkoon.gan@nintex.com> | M: 65 8332 7738 | T:65 6407 1059

<https://twitter.com/nintex> <https://www.facebook.com/Nintex> <http://www.linkedin.com/company/nintex> <http://www.youtube.com/nintex>