cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Attachment links in 'Send e-mail'

Hello!

This post is to share the solution i cooked together from Nintex guide, user-made guide and some of my own additions.

The orginal goal was to send attached files in email through a Nintex workflow, but that does not seem possible at the moment, not easily at least?, but the goal changed.

Goal: To send links of the attachments though the workflow 'Send e-mail'.

Result: The ability to put direct links to the attached files direct from the sharepoint list in 'Send e-mail'

What it does: The workflow will loop through the attachments and store the filenames for each file in a collection. Then it counts the amount of items in the collection and grab each input and put it in a variable. The latter part is handled in a bunch of Run if's and therefor in my case I allowed 3 max attachments. If no attachments the workflow will continue as you build it for, and the filename variables will be empty in the mail.

Disclaimer: This might not be the smartest solution, and i've yet to look at the optimizing to see if i can cut out steps in the workflow. But it works, which is a good thing ;) My Nintex is default to Danish, so i might name some of the operations a bit wrong in english.

How to

Step 1

Setup the Web service call and get filename loop. This part is based on Alan Richards' Nintex attachment workflow​ with some minor changes. Follow that guide with these changes:

What to skip: Office 365 Upload file

What to add: In between the second 'Do Calculation' and 'Set Workflow Variable' add a 'Add Item to Collection' with the following values:

1.PNG

The collection can be named what ever you want, i made it from the from the settings on the go.

Step 2

Count the collection and build variables (outside the loop from step 1)

1. Add a 'Count Items in Collection' with the following settings: Target collection: target_collection, total items: items_in_collection  (new variabel: integer)

2. Add 'Run if' with the following settings: Expression when 'workflow variables' items_in_collection equals value 1

2.1 Inside the 'Run if' add a 'Get Item from Collection' with the following settings:

2.2.1 Target collection: target_collection, Index equals value 0, Output: Output1 (new variable, text)


Repeat step 2 and 2.1 for the number of attachments you want to handle and change step 2. Expression when 'workflow variables' items_in_collection equals value X with the number and the 'Get items from Collection' as shown below

Eg. for 3 attachments the values will be

2. Expression when 'workflow variables' items_in_collection equals value 3

2.1 Inside the 'Run if' add a 'Get Item from Collection' with the following settings: Target collection: target_collection, Index equals value 0, Output: Output1

2.2 Inside the 'Run if' add 3 'Get Item from Collection' with the following settings:

2.2.1 Target collection: target_collection, Index equals value 0, Output: Output1

2.2.2 Target collection: target_collection, Index equals value 1, Output: Output2

2.2.2 Target collection: target_collection, Index equals value 2, Output: Output3

Rule is to change the Run if's according to number of attachments and then add the variable handling inside according to the number of attachments. You only need one set of variables because of the Run If's. Remember to lock the attachment max value accordingly in the attachment control in the form!

Step 3

Build URL variable and insert links in the mail

1. Add a 'Set workflow variable' with the following settings

1.1 Variable: Site_url (name it whatever, new variable: text)

1.2 Value: https://yoursharepointsite.sharepoint.com/value/sitename/Lists/list-name/Attachments/{Current Item: ID}/

Add your own sharepoint site values. Beware of the list name if it got spaces!

2. Add an 'Send e-mail' fill out accordingly. In the body hit insert link and use the following:

2.1 URL: {Variable: URL}{Variable: Output1}

2.2 Hyperlink text: {Varibale: Output1}

Repeat after wishes and/or number of attachments

That should be it - you're done!

Feel free to ask questions and/or post improvements/whatever your want!

/Rasmus

Ps. Ill try to add some more screenshots at a later time.

Pps. I don't know if this 'guide' already exists, sorry if it does.

Labels: (1)
Reply
5 Replies
Highlighted
Not applicable

Re: Attachment links in 'Send e-mail'

This is a fantastic guide! I've been looking so long for this - just why, oh why it has to be so complicated in Nintex 365.

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Attachment links in 'Send e-mail'

Rusmus,

Very new to SP and Nintex, in the hope of finding a solution of my case, I found your post, but it is not working for me... :( Hope you can give your insight!

My goal is to find a filename of Attachment. I'm working on DocuSign solution, and it requires attachment filename for my scenario. After this works, I'm willing to try your guide to add URL to email as well!

I reviewed Alan's video and created my workflow, in a simple version (because I only need to find a filename).

I changed:

- Call HTTP web service: GetByTitle(ListName context)    *because I think his 'QualityFilesList' is his ListName

- Get Item from Dictionary: d/results(0)/FileName                *because I am not using Loop, I also tried with 1 just in case


There are no errors in WF, but my variable returns empty.

Is there any errors on these blocks, or is there another way of finding attachment filename?

Thank you very much in advance!

-Naoko

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Attachment links in 'Send e-mail'

Hey Naoko,

Just a few preliminary things to try,

Does your list name have any spaces?

Have you tried removing the (0) and (1) just for testing to see if you get anything like this?

I notice in your HTTP web service that you don't have single quotes ' around your List name, perhaps this is the issue? It should be ('listName') 

Let me know if none of these resolve it for you! I would try the last one first.

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Attachment links in 'Send e-mail'

OMG!! a simple little thing to fix a problem!

I needed quotes. This is very cool.

Thank you sooo much!

-Naoko

0 Kudos
Reply
Highlighted
Nintex Newbie

Re: Attachment links in 'Send e-mail'

It happens to the best of us! Glad you were able to find your solution!

0 Kudos
Reply