a single variable that can add multiple email attachments

  • 11 November 2015
  • 2 replies
  • 1 view

Badge +4

I want to send an email with attachments from an unrelated library. I know I can attach via URL to that particular file. But what if the files to be attached are based on query conditions, so now each emails will have different files and different number of files to attach.

 

I have the query part done, and it's building a collection variable "col_collected_urls" with the URL's of all the files that should be attached. Is there any tricks with the syntax for the variable I assign to the Email Attachments so that it can be loaded with multiple URLs. 

 

I tried a few guesses with HTML or multi-line text but didn't get anywhere. I'd rather not create X number or empty variable and fill them because I don't know how many will it max out at.


2 replies

Badge +11

Were you able to resolve this issue? Could you please post your resolution to help others on the community.

Badge +17

Since you have that data in a collection, here's what I would propose:

Use the for each action against every item in the collection - output each item as a single URL

  • Then inside the for each, set a variable to store the single URL
  • Then use the build string to capture the URL plus the next URL or {Multi-URL}{Single URL}
  • Then output the build string outside the loop.

What should happen is the loop will go through each URL and push it into the variable below it. You can then capture that URL and store it in a table or whatever as part of the build string.

The output of the build string will then be a collection of all the URLs outputted in order and in a readable format, not just a collection with semi-colons. 

If you care to export your workflow and list template, someone may be able to configure it for you quickly. :-)

Cheers.

Reply