- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2022 02:49 AM
when a catalog item request is submitted a notification will be triggered to the requestor. We have a field where the requestor can enter multiple email id's as shown in snippet. Now we need to send notification to all the mentioned email id's including the requestor. How can we achieve that
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2022 03:38 AM
Hello,
No your event Queue declaration needs correction we can send only two parameters in events
push your requested for email also into the array like below
var emails = current.email_address.split(',');
emails.push(current.variables.requested_for.email.toString());
gs.eventQueue('signavio.request.created' ,current,SON.stringify(jsonObject),emails );
I am sending your resuested for emails and the other emails also at a time in one parameter instead of multiple
please accept the solution if you find it helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2022 03:00 AM
Hello,
I would suggest to change the field type of multiple emails.
Because it will be considered as a entire string but not multiple ones as you are storing it in single line texxt type field
Use List collector type field and tag users there and then you can write the script as below to get the users in that field and send it in event parameters as recpients
var emails = current.email_address.split(',').toString();
and pass emails variable as the parameter
please accept the solution if you find it helpful
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2022 03:05 AM
we cant use list collector as users are not in servicenow user tble
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2022 03:09 AM
Okay there is only one way to do this then.
Can you make sure that user will enter emails with comma separated values
like xyz2gmail.com,abc@gamil.com in that field .
This ", " is the way to find or an unique symbol to find out that there are multiple values in teh string field other wise it gonna take all the emails as a single line
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2022 03:13 AM
yes i can do that . so what should be the script and where exactly i need to write it