DEV Community


Posted on

ServiceNow: Using event parm to send custom object or array

The gs.eventQueue is a nice way to trigger events, which you can use in a variety of ways. For example trigger a notification. With the parm1 and parm2 you can send strings, which you can use in a mail script. Sometimes we need more information passed to the mail script.

Here we can use our lovely JSON.stringify() to send custom JSON objects or arrays with the help of parm1 and parm2. Both are string fields and have a length of 4000. So plenty of space to send your array or object.

In the email script you can then use the JSON.parse() to parse the string back to your object or array and then use it however you like.

alt text

Top comments (0)