How to Trigger notification in UI action

Apsara P
Tera Contributor
 
2 REPLIES 2

Saurav11
Kilo Patron
Kilo Patron

Hello,

 

If you want to trigger notification from UI action you need to use gs.eventQueue syntax:-

 

gs.eventQueue('eventname',current,Paramenter1,Parameter2);

 

You can follow the below article as well for the same

 

https://www.servicenow.com/community/spm-forum/how-to-generate-notifications-by-using-ui-action/m-p/...

 

Please mark answer correct/helpful based on Impact.

AishwaryaShukla
Kilo Guru
Kilo Guru

Hi @Apsara P 

 

You set up your notification to be triggered on event. And specify the event name.
Then, in the UI action you can trigger the event, which will in turn trigger your notification.

Below is the syntax to trigger an event:

gs.eventQueue('eventname',current,Parameter1,Parameter2);

Here, 'current' is the GlideRecord object of any record. Parameter 1 and 2 can be used in the notification as well, where you pass the receiver's email id or other info.

Do let me know if this works for you.
Kindly mark this answer as correct, so that others can also benefit from it.

Thanks,
Aishwarya