Passing through Catalog variable in workflow event param 1 to populate the who gets a notification
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi,
I have a catalog item that has 2 variables I would like to pass through the workflow with 2 different events and populate who get the notification.
The first variable they select a support group (assignment group) and want that groups manager passed through for the email notification.
The second is a lookup list of sys_user and I just want that list of selected users passed through the notification.
I've tried version of the script below in Event parameter with no success.
(function() {
answer = [];
answer.push(current.variables.platform_support_group.manager);
return "";
}());
(function() {
answer = [];
answer = current.variables.individual_notificaitons.toString().split(',');
return "";
}());- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @wiganmichae
Hope this scripts from workflow ,
comment this line and try
// return "";
And do some null checking like
(function() {
answer = [];
if(current.variables.platform_support_group.manager){
answer.push(current.variables.platform_support_group.manager);
}
}());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago - last edited 2 weeks ago
The individual one is working fine now and passing through but the support group manager is still a no go if I comment out the return line or use the suggested script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
how are you sending the email? are you using workflow email activity?
share some screenshots
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 weeks ago
I'm using workflow to generate an event that sends notification, we went that way to have more control over how the notification is used and also be available to other items.
The notification has a list of emails that it goes to also push through the manager of the support group selected from the catalog variable.
