Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Send Notification

Mark Wood
Tera Contributor

Hello Experts,

I want to send a notification when a request is raised for a catalog item. on my catalog item, I have a list collector variable. if I select multiple users in the list collector variable I want to send a notification to all users who are in that list collector variable. (I am trying to send a notification using flow).

how can I achieve this please guide me thank you.

1 ACCEPTED SOLUTION

Hi,
You can use below script for mail addresses.

var email=['noreply@noreply.noreply'];
var ids=new GlideRecord('sys_user');
ids.addEncodedQuery('sys_idIN'+fd_data.trigger.current.watch_list+"");//fd_data.trigger.current.watch_list you need to change this as this is as per my field on table. You can change as per you catalog variable
ids.query();
while(ids.next())
{
    email.push(ids.getValue('email'));
}

return email.join(",");

SaurabhGupta_0-1703335357384.png

 


Thanks and Regards,

Saurabh Gupta

View solution in original post

11 REPLIES 11

Hi,
You can use below script for mail addresses.

var email=['noreply@noreply.noreply'];
var ids=new GlideRecord('sys_user');
ids.addEncodedQuery('sys_idIN'+fd_data.trigger.current.watch_list+"");//fd_data.trigger.current.watch_list you need to change this as this is as per my field on table. You can change as per you catalog variable
ids.query();
while(ids.next())
{
    email.push(ids.getValue('email'));
}

return email.join(",");

SaurabhGupta_0-1703335357384.png

 


Thanks and Regards,

Saurabh Gupta

Unique45
Mega Sage
Mega Sage

Hello @Mark Wood,

1) Get List collector Catalog Variable Using 'Get Catlog Variables' Action:

Pratiksha_PP_0-1703339880300.png

2) Using Send Email Action you can send email and in the To select List Collector Variable.

 

Pratiksha_PP_1-1703340189137.png

 

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.

 

 

Please mark correct/helpful if this helps you!