The Zurich release has arrived! Interested in new features and functionalities? Click here for more

sys_email instance variable

AdriàM
Tera Contributor

I'm having a problem where I try to get the value of the instance variable from a business rule on Insert of the table sys_email when an email is recieved.
I found that the value isn't defined after some updates, so I changed the business rule, but the sys_email is updated 4 times.
I'd like to know why ServiceNow does so many updates on the sys_email registry.

 
(function executeRule(current, previous /*null when async*/) {
	if(current.instance) gs.log("id ritm: "+current.instance.toString());
	else gs.log("INSTANCE NOT ASSIGNED");
})(current, previous);
2 REPLIES 2

Nehal Dhuri
Mega Sage

Hey @AdriàM ,
have you tried current.getDisplayValue('instance') ?

 
Please hit like and mark my response as correct if that helps

Ankur Bawiskar
Tera Patron
Tera Patron

@AdriàM 

what's your business requirement here?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader