Flow Designer - need help with sending email

JLeong
Mega Sage

Hi Guys,

I need to send an email from a Flow Designer. The email must contain the values of a list collector. I need help adding these values to the body of the email.

Example email:

Hi Joe,

Request #123456 has been completed. You are now the owner of the following accounts:

  1. List collector value 1
  2. List collector value 2
  3. List collector value 3

 

Please assist.

Thank you!

Regards,

Jocelyn

 

 

 

1 ACCEPTED SOLUTION

@JLeong 

you cannot use For each loop directly on list collector variable.

you will have to convert String and return String Array which can then be used in For Each

Refer below links for help and the steps

Flow Designer

How to iterate an Array.String in the flow designer?

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

View solution in original post

11 REPLIES 11

sachin_namjoshi
Kilo Patron
Kilo Patron

You can use send email action to send email to list collector

The "To" address will contain list of users from glide list

 

You can use following script to get list of users

 

var list = current.watch_list.toString();
var array = list.split(",");
for (var i=0; i < array.length; i++) {
   gs.print("Reference value is: " + array[i]);
}

 

https://docs.servicenow.com/bundle/paris-servicenow-platform/page/administer/flow-designer/reference...

 

Regards,

Sachin

 

 

H Sachin,

Thanks for your response. I used your script to get the values of the list collector. But how can I incorporate that to the body of the email?

Thanks.

Deepen Shah
Kilo Guru
 

Do you have all these list collectors as data pill in any action step or trigger?

Regards
Deepen shah
aavenir.com

Hi Deepen,

Thanks for responding. I am not sure how to put it in an action step. Could you assist me?

I have this code in the body of the email but it only lists the accounts.

find_real_file.png

I need to format the email like this:

Hi Joe,

Request #123456 has been completed. You are now the owner of the following accounts:

  1. List collector value 1
  2. List collector value 2
  3. List collector value 3

 

I hope you can help.

Thank you!