How to send a variable number of attachments in an email?
Hello,
I'm wondering how are you able to loop through a list of attachments, and include all the attachments that are related to an order in an email.
Currently, I'm using 2 sets of tables. The first one (order table) contains a list of all the orders to process, while the second table (documents table) contains a list of documents that relate to the different orders from the order table.
I'm using a Start process for each row action for the order table. But when using the Send Email Action I must enter the field that you have named for a specific document. For my example, the number of documents can change from 1 to 5, so instead of creating a single process for each document to assign it in a field, I would like to know if there is a dynamic way to ingest a variable number of documents in the attachment field.
Thanks in advance
Best Answer
-
Nicely done, @Rafael_943505. I'm working on a pattern that does exactly this and will post to our Show and Tell section once ready.
Edit: You can also use this formula to convert the file URLs to file IDs for the entire file column in the trigger-attachments table.
5
Answers
-
@Rafael_943505 If you use Tables: Start workflow for each row with a table containing a list of order numbers, you should be able to use Tables: Apply filters to filter your attachments table. Once filtered, you can use Tables: Convert data table to text to save the file IDs to a text field, with a comma (,) as the row delimiter. This gives you a field with a comma-delimited list of attachments that you can send in an email.
0 -
Hi Thomas, Do you know from which field I can extract the attachment ID?
0 -
Hi Thomas, I got it! I have used the action Text Find and replace to remove "https://TEAM.pushbot.com/v1/teams/TEAM/files/" and "/download" from the file field.
Thanks a lot for your help1