Building Dynamic CC Array for MailerSend in Make.com

Hi,

I prepared a small scenario that shows what I’m trying to achieve.

  • The webhook/module returns up to 10 flat email fields (email1email10). Some may be empty (e.g., email3 has no value).

  • I need two outputs:

    1. a comma-separated string with only the non-empty emails — this works;

    2. an array/list of objects like { "email": "<address>" } to map to MailerSend’s CC field.

When I try to build the array dynamically in Make, the formula either returns an empty result or treats the email value as a key. I haven’t been able to find a working formula. I’ve tried multiple approaches (using toCollection, add, array, and conditional filters), but I still get an empty array or a mis-keyed structure.

Could you point me to a reliable pattern or example for creating the CC array from these optional fields?

{{add(emptyarray; if(length(trim(1.email1) > 0); toCollection("email"; 1.email1; ); emptyarray))}}

Thank you.

Integration Tools.blueprint (1).json (17.5 KB)