Accessing Inserted Record in Notification Content

andreea_luca
Tera Contributor

Hi,

I have a notification that is sent when an event is fired. The event occurs when a record is inserted into the table.

How can I access the record inside the notification? As you can see in the screenshot, I tried using a variable selected within the notification content, but it doesn't seem to work.

Does anyone have any ideas?

1 ACCEPTED SOLUTION

BrahmjeetTanwar
Tera Guru

Hey Andreea,
Are you firing this event from business rule on record insertion? If yes, then please pass the the "current" gliderecord object in event params and then create a notification email script and access the information using event parameter - event.parm1.variablename and then use that email script in notification using syntax - ${mail_script:scriptname}. Please let me know if you have any questions 🙂

Thanks,
Brahm!

View solution in original post

4 REPLIES 4

Sujatha V M
Kilo Patron
Kilo Patron

@andreea_luca  You can use "Notification Email Scripts" to access the related record and display it on the notification as mail script. 

 

Reference link : https://docs.servicenow.com/bundle/washingtondc-platform-administration/page/script/server-scripting...

 

Please mark this as helpful and accept it as a solution if this resolves your query.

Thanks,

Sujatha V.M.

Please mark this as helpful and accept it as a solution if this resolves your query.
Sujatha V.M.

BrahmjeetTanwar
Tera Guru

Hey Andreea,
Are you firing this event from business rule on record insertion? If yes, then please pass the the "current" gliderecord object in event params and then create a notification email script and access the information using event parameter - event.parm1.variablename and then use that email script in notification using syntax - ${mail_script:scriptname}. Please let me know if you have any questions 🙂

Thanks,
Brahm!

Record insertion

great! Please pass current object in parameters of event and then use same in notification email script.

Do you need further help with the code?