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

How to dot walk Document Id field in Notification?

Gayathri5
Tera Guru

Hi,

 

I am having Trigger Id field which is of type documentId which is referencing incident table record.

So from notification fields can we achieve this?

I tried Dear ${trigger_id.caller_id.getDisplayValue()}, but it is not displaying anything

 

 

Regards,

Gayathri

7 REPLIES 7

Prasad Pagar
Mega Sage

Hi @Gayathri 

On which table you are triggering this notification?

Thank you
Prasad

Jaspal Singh
Mega Patron
Mega Patron

What table notification is on

Gayathri5
Tera Guru

Notification on assessment instance table

 

 

1. Create a mail script named: getcallernamedetails

2. Script as below

(function runMailScript(current, template, email, email_action, event) {

    var triggeridis = current.trigger_id; //will give you sys_id of record
    var getcallername = new GlideRecord('incident');
    getcallername.addQuery('sys_id', triggeridis);
    if (getcallername.next()) {
        template.print('Caller is ' + getcallername.caller_id.getDisplayValue());
    }

})(current, template, email, email_action, event);

 

Call mail script in the notification as

${mail_script:getcallernamedetails}

 

Above will work hoping the caller_id field you referring to is on incident table.