- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2023 11:20 PM
Hello
I want to send multiple values like 8 to 10 values from my script include to email body of Notifications. I am using event triggering based approach. How to send this.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2023 11:39 PM
What type of values?
One example would be to create a JSON object, send that and handle the values in email script.
For example:
obj = {};
obj.value1 = "value1";
obj.value2 = "value";
objString = JSON.stringify(obj);
gs.eventQueue('event_name, current, objString, "");
In your event you pass the objString and then in the email script you can parse it as:
var obj = JSON.parse(event.parm1);
//Then you can either loop it or access the values how you want.
for(var i in obj){
template.print(obj[i]);
}
//or
template.print(obj.value1);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2023 01:29 AM
Hello,
In notification -> What it will contain section, you can make use of mail script like this
And you can create the email script to fetch the values from the object
If my response resolves your issue please mark correct or helpful.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-05-2023 10:56 PM
<br>
For example
template.print("Hello,<br>How are you?");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-06-2023 03:17 AM
Thanks @Weird Can you tell me if we have Websockets in ServiceNow?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2023 10:49 PM
Yes, though I can't say I'm very familiar with the concept.
Websocket has been around for a while and it should be enabled by default if I remember correctly.