Convert CC E-Mail adresses into comma-separated list

My scenario starts with Microsoft365 E-Mail watcher and returns a new email.

In that e-mail there can be “CC” recipients (array):

image

I would like to get a comma separated string of those “CC” recipients to use in the next step.

For e.g. if there is hi@abc.com and hello@def.com the result should be

hi@abc.com, hello@def.com

If possible, if only one result, there shouldnt be a comma.

Could anybody help me with that?

Thanks in advance,
Enrico

You can use the built-in function map and join

e.g.:

{{ join(map(CC_RECIPIENTS; email.name); ",") }}

For more information, see

Links

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —

General

Help Center Basics

  • Mapping – What is mapping? What can I map? ← CHECK THIS OUT
  • Mapping with arrays – How to map items in an array ← CHECK THIS OUT

If you need further assistance, please provide the following:

Please provide the output bundles of the modules by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download output bundles”.
Screenshot_2023-10-06_141025

A.

Save the bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.
Uploading it here will look like this:

bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted output bundle in this manner:

  • Either add three backticks ``` before and after the code, like this:

    ```
    input/output bundle content goes here
    ```

  • Or use the format code button in the editor:
    Screenshot_2023-10-02_191027

Providing the output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

This will allow others to better assist you. Thanks!

2 Likes

Hi samliew

Thanks for you help!

Unfortunately this didn’t work. I get a “,” as result:

This is what i put into the field:

{{join(map(1.ccRecipients; 1.ccRecipients[].emailAddress.address); ",")}}

Input Bundle:

 {
        "name": "asdfsadfsadf [XX]",
        "status": "Open",
        "list_id": "XX",
        "task_id": "XX",
        "team_id": "XX",
        "space_id": "XX",
        "assignees": {},
        "folder_id": "X,
        "custom_fields": {
            "XX",
            "XX": "enrico@walsermedia.email",
            "XX": ","
        },
        "addCustomFieldDateTime": false
    }
]

relevant part of the output bundle:

"custom_fields_original": [
            {
                "id": "xxx",
                "name": "CCs",
                "type": "short_text",
                "type_config": {},
                "date_created": "2024-02-12T10:06:37.408Z",
                "hide_from_guests": true,
                "value": ",",
                "required": false
            },

Thanks,
Enrico

Second parameter of the map function has to be a raw value, and cannot reference the original array again.

Remove 1.ccRecipients[].

Can you please provide screenshots as requested?

2 Likes

i can not remove that part, because then the field is not valid.

image

image

Remove the black invalid part.

Type emailAddress.address at the same spot

2 Likes

Thanks, @samliew. That worked.

image

2 Likes

No problem, glad I could help!

1. If you have a new question in the future, please start a new thread. This makes it easier for others with the same problem to search for the answers to specific questions, and you are more likely to receive help since newer questions are monitored closely.

2. The Make Community guidelines encourages users to try to mark helpful replies as solutions to help keep the Community organized.

This marks the topic as solved, so that:

others can save time when catching up with the latest activity here, and

  • allows others to quickly jump to the solution if they come across the same problem

To do this, simply click the checkbox at the bottom of the post that answers your question:
Screenshot_2023-10-04_161049

3. Don’t forget to like and bookmark this topic so you can get back to it easily in future!

1 Like