- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2020 01:04 PM
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:
- List collector value 1
- List collector value 2
- List collector value 3
Please assist.
Thank you!
Regards,
Jocelyn
Solved! Go to Solution.
- Labels:
-
flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-04-2020 07:34 AM
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
How to iterate an Array.String in the flow designer?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2020 01:13 PM
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]);
}
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2020 07:26 PM
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.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-02-2020 09:36 PM
Do you have all these list collectors as data pill in any action step or trigger?
Regards
Deepen shah
aavenir.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-03-2020 03:49 AM
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.
I need to format the email like this:
Hi Joe,
Request #123456 has been completed. You are now the owner of the following accounts:
- List collector value 1
- List collector value 2
- List collector value 3
I hope you can help.
Thank you!