How to send a variable number of attachments in an email?

Options

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

Tagged:

Best Answer

Answers

  • Thomas_937381
    Thomas_937381 Posts: 196
    edited July 2020
    Options

    @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.

  • Rafael_943505
    Options

    Hi Thomas, Do you know from which field I can extract the attachment ID?

  • Rafael_943505
    Rafael_943505 Posts: 21
    edited July 2020
    Options

    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 help