571
Views
12
Comments
Concatenate email addresses from list
Question

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. 

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Oliver,

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

UserImage.jpg
Oliver Silva

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?

2019-08-15 15-11-20
Roel Bernardo

Hi Oliver,

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

-Roel

UserImage.jpg
Oliver Silva

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.


2019-08-15 15-11-20
Roel Bernardo

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.


2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

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.

UserImage.jpg
Oliver Silva

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?

2021-10-26 09-17-56
João Delgado

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

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

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

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

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)?

UserImage.jpg
Oliver Silva

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.


2021-10-26 09-17-56
João Delgado

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

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.