Difference between Param1 & Param2

Geeky
Kilo Guru

What is the difference between Param1 & Param2? I think both are used to store email recipients and passed to the event for triggering the notification. We can use Param1 everytime but when is Param2 is used? Why do we have 2 parameters for notifications?

 

Event parm 1 contains recipientSelect this check box if the event parameter 1 contains one or more email recipients (in a comma separated-list). This field is visible only when the Send when field is set to Event is fired.
Event parm 2 contains recipientSelect this check box if the event parameter 2 contains one or more email recipients (in a comma-separated list). This field is visible only when the Send when field is set to Event is fired.

 

3 REPLIES 3

ggiri1
ServiceNow Employee
ServiceNow Employee

Hi Srini,


You can use then for other purposes specially when we are using the Email Scripts. Please see below example from Docs:

https://docs.servicenow.com/bundle/jakarta-platform-administration/page/administer/notification/task...

""

var id = event.parm1.toString();
var gr = new GlideRecord('sc_req_item');
gr.get('sys_id', id);
if (gr.next()){
// Do something.
}
""

Thanks,
Giri Guntoju

Hi Giri,

I understand that params can be used for scripting purpose also and I can use either of them. In the example also, it shows we can use Pharam 1 but it doesn't clarify any difference.

 

Why do we have 2 params? What is the significance ? There must be some reason behind it, I want to know the difference between them.

scott barnard1
Kilo Sage

Hi Srini

 

If you look at the events business rules on each table for example -  incident events

 

you'll see a bunch of if statements eg.

 

if (!current.assignment_group.nil() && current.assignment_group.changes()) {
gs.eventQueue("incident.assigned.to.group", current, current.assignment_group.getDisplayValue() , previous.assignment_group.getDisplayValue());

 

So if the current assignment group is not nil and it has changed it will add an event called incident.assigned.to.group to the event queue

It will get created and param 1 will be the display value of the current assignment group and param 2 is the previous one.

 

Basically that rule passes an event with 2 parameters, the notification can be configured to use one as a recipient or you can just use the recipients listed.

 

You can also pass up to 2 parameters from a workflow when you use the create notification object. It's the same thing and tends to get used for task_sla based notifications

 

Regards