Concatenate email addresses from list

I have a list of email address I need to iterate through and concatenate them into to TO field of an Outlook message via the ExternalURL function using the "mailto:" feature. I can do it with a single record but I don't know how to make it iterate through an entire list. 

I have a list of people who are assigned to a project. Each person record has a personal and work email address. The goal is to have a single button that launches Outlook and inserts all of the email address from everyone assigned to that project. 

Hi Oliver,

The Text Extension has a nifty Action, String_Join, that allows you to do this:

Hi Oliver,

Have you tried using the For Each on your fetched records?? 

-Roel

Kilian Hekhuis wrote:

Hi Oliver,

The Text Extension has a nifty Action, String_Join, that allows you to do this:


Thanks, Kilian. So I would need to add this action after my For Each and have it populate a record in Structures?

Roel Bernardo wrote:

Hi Oliver,

Have you tried using the For Each on your fetched records?? 

-Roel

Yup. I know I need to use For Each, but I'm not sure how I get it in one message. I don't want it to open an Outlook message box for every record. Just want one single message with all of the email addresses.


Oliver,

What For Each do you have? Since String_Join needs a Text List, you can assign the output of the Aggregate directly to the List Parameter, and map the right e-mail Attribute, like this:

The result will be a single, comma-seperated list that you can use as To-address.

Oliver Silva wrote:

Roel Bernardo wrote:

Hi Oliver,

Have you tried using the For Each on your fetched records?? 

-Roel

Yup. I know I need to use For Each, but I'm not sure how I get it in one message. I don't want it to open an Outlook message box for every record. Just want one single message with all of the email addresses.


I see. Then String_Join is your friend here as per Kilian Hekhuis said earlier.


Hi Oliver,

You can do something like this:


And in the e-mail properties you will replace the "To:" content with the output of the string join.


Best regards,


João Delgado

That's what I already wrote João ;)

Kilian Hekhuis wrote:

Oliver,

What For Each do you have? Since String_Join needs a Text List, you can assign the output of the Aggregate directly to the List Parameter, and map the right e-mail Attribute, like this:

The result will be a single, comma-seperated list that you can use as To-address.


I've almost got it! I'm just getting an error saying it can't parse the hostname. 

When I debug, here is what it is passing.

It looks right to me, but maybe the external URL doesn't like the quotes at the beginning and end of the string? Thoughts?

The quotes aren't actually part of the string, so that's not the problem. What I find odd though is that the comma is now a semi-colon. Do you by any chance have translated it (wrongly)?

Kilian Hekhuis wrote:

The quotes aren't actually part of the string, so that's not the problem. What I find odd though is that the comma is now a semi-colon. Do you by any chance have translated it (wrongly)?

I tried it both ways with comma and semi-colon - neither worked. It still comes up with the "hostname could not be parsed" error.


Oliver,

You are facing an error that seems to be "normal". I did a small research and saw a significant number of people facing that issue.

You can achieve what you want with the following steps:

1) Add a simple code in the WebScreen Javascript and create a Local Variable of type Text (In my case named StringMail):

2) In the action, associated with your button, add the following steps:

   



Just guarantee that your browser is allowed to open pop ups.


Best regards,

João Delgado