How send Multiple values into workflow event parameter?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2025 05:28 AM
Through workflow I have triggering the notification for that i have using workflow event activity but that have the 2 parameters how send multiple parameters and how to configured in notification body
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2025 05:46 AM
HI @siva44 ,
You can use the Sample script below :
you can write something like the following script in the event1 param field of the create event activity as:
(function() {
var arr= [];
arr.push(current.variables.owned_by);
arr.push(current.variables.managed_by);
arr.push(current.variables.primary_product_owner);
arr.push(current.variables.requested_for.requester_name);
return arr.toString();
}());
Here all the users are stored in an array and returning that array to the event param1.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2025 05:54 AM
Hi @Community Alums could u pls provide script for notification body How call that array in email body
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2025 06:00 AM
for that you need to use email script.
check my below response and it will help you to grab the values
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2025 05:55 AM
for sending multiple parameters and values, you will have to use email script to grab those values.
in workflow send this in event parm1
return current.variables.first_name + ',' + current.variables.line_manager;
Then in email script get the value and split and use in email body
(function runMailScript(current, template, email, email_action, event) {
// Add your code here
var parm1 = event.parm1;
var arr = parm1.toString().split(',');
var name = arr[0];
var manager = arr[1];
template.print('Name' + name);
template.print('Manager' + manager);
})(current, template, email, email_action, event);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader