The CreatorCon Call for Content is officially open! Get started here.

Why might a Notification variable like ${caller_id.manager.name} show blank?

ServiceNow Use6
Tera Guru
Hi,

Why might a Notification variable like ${caller_id.manager.name} show blank? I tried multiple ways but it is not working. Kindly help.

Regards

Suman P.

 

1 ACCEPTED SOLUTION

TejasLogicX_11
Mega Contributor

Hi @ServiceNow Use6  ,

 also you can try this using the email script and call email script in notification 

1)create notification email script .( enter name and paste this code);

 

 

(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
    /* Optional EmailOutbound */
    email, /* Optional GlideRecord */ email_action,
    /* Optional GlideRecord */
    event) {
    // Add your code here
    var mgrName = "";
    if (current.caller_id.manager) {
        mgrName = current.caller_id.manager.getDisplayValue();
    }
    template.print(mgrName);
})(current, template, email, email_action, event);

 

 

2) call that notification email script in you notification.

 

${mail_script:your_notification_email_script_name}

 

 

 

TejasLogicX_11_0-1758181384406.pngTejasLogicX_11_1-1758181488868.png

Output

TejasLogicX_11_2-1758181750292.png

 

user form 

 

TejasLogicX_11_3-1758181800761.png

 

 

If my response/article helped you, please mark it as the correct answer and close the thread — this helps other readers in the community.

Regards,

Tejas 
🚀 ServiceNow Developer | 🏆 HackaNow Finalist | 💡 Community Contributor
📧 Email: tejas.adhalrao11@gmail.com
🔗 LinkedIn: linkedin.com/in/tejas1018

View solution in original post

6 REPLIES 6

J Siva
Kilo Patron
Kilo Patron

Hi @ServiceNow Use6 
Check if the 'Caller' has a Manager value. If it exists, the it should show in the email.
Also, ensure that your Notification record is being created on the correct table.
As per OOB, caller_id field belongs to the Incident table. So, your notifictaion record should be created on the incident table.
Regards,
Siva

TejasLogicX_11
Mega Contributor

Hi @ServiceNow Use6  ,

 also you can try this using the email script and call email script in notification 

1)create notification email script .( enter name and paste this code);

 

 

(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
    /* Optional EmailOutbound */
    email, /* Optional GlideRecord */ email_action,
    /* Optional GlideRecord */
    event) {
    // Add your code here
    var mgrName = "";
    if (current.caller_id.manager) {
        mgrName = current.caller_id.manager.getDisplayValue();
    }
    template.print(mgrName);
})(current, template, email, email_action, event);

 

 

2) call that notification email script in you notification.

 

${mail_script:your_notification_email_script_name}

 

 

 

TejasLogicX_11_0-1758181384406.pngTejasLogicX_11_1-1758181488868.png

Output

TejasLogicX_11_2-1758181750292.png

 

user form 

 

TejasLogicX_11_3-1758181800761.png

 

 

If my response/article helped you, please mark it as the correct answer and close the thread — this helps other readers in the community.

Regards,

Tejas 
🚀 ServiceNow Developer | 🏆 HackaNow Finalist | 💡 Community Contributor
📧 Email: tejas.adhalrao11@gmail.com
🔗 LinkedIn: linkedin.com/in/tejas1018

ChallaR
Mega Guru

hi @ServiceNow Use6 ,

Go to the record whichever table you are using  and check below data is there are not .

 

  • caller_id is populated.
  • caller_id.manager is populated.
  • caller_id.manager.name is not empty.

Fix -Ensure the caller_id user has a manager assigned in their user profile (sys_user table).

 

If the notification is triggered before the record is fully saved, the manager field might not be available yet.

Fix- Use "After Insert" or "After Update" as the notification condition to ensure all related fields are populated.

NOTE - please check if ACLs on the sys_user table and ensure the notification has access to caller_id.manager.name.

 

and test in business rule or script like below mentioned script -

gs.info(current.caller_id.manager.name);

 

Please make it correct and close the thread if this is working.

 

Thanks,

Rithika

Bhuvan
Mega Patron

@ServiceNow Use6 

 

Did you check the table on which email notification is created is correct one and dot-walked fields are available in the target table ?

 

If yes, check if the Caller ID has Manager field set and you are able to retrieve the details.

 

Do a simple test from Script Background like below

 

Bhuvan_0-1758182238983.png

Bhuvan_1-1758182254441.png

Bhuvan_2-1758182292364.png

If this helped to answer your query, please mark it helpful & accept the solution.

 

Thanks,

Bhuvan