Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Fire event from record producer

Sandy7
Tera Expert

hello,

I have a record producer, and I need to trigger an event from a dropdown variable value. 

So, on the record producer I have a variable called Location. If location = A, I want an event trigged so I can call it from a notification.

I have this in the Record Producer script but it is not working.. 

I dont think i have it coded properly. Any ideas?

 

Thanks 

var location = producer.associate_site_and;


if (location == 'Internal - Charlotte') {

gs.eventQueue("contact_center_internal", current, eventParm1);
}

 

9 REPLIES 9

Anurag Tripathi
Mega Patron
Mega Patron

What is eventParm1?

If you are not passing any parameter then use this

 

var location = producer.associate_site_and;

if (location == 'Internal - Charlotte') {

gs.eventQueue("contact_center_internal", current, '','');

}

-Anurag

Hi, I am not actually passing a parameter so I removed that (I think it was a copy and paste error).

I have tired the code you added and it's still not working.. any other ideas?

here is what my record producer script looks like.. also, on the event registry, I have tried to set it to both tables "incident" and the sc_cat_item_producer table. 

Thanks

find_real_file.png

Sorry - I have added your code and then also tested with what Mike Patel added below which is what you see in the screenshot and I can't get either to fire the event. thanks again!

See if the code is coming in the if by adding log right above the event queue

 

var location = producer.associate_site_and;

gs.log('location='+location, 'MyLog');

if (location == 'Internal - Charlotte') {

gs.log('coming here', 'MyLog');

gs.eventQueue("contact_center_internal", current, '','');

}

-Anurag