how to populate employee name in email notification form employee id

Mehar Naaz1
Tera Contributor

how do i populate employee name in email notification form employee id.Can anyone suggest a solution? Thanks in advance. 

4 REPLIES 4

piyushsain
Tera Guru
Tera Guru

Hi,

Use the below code in the email script

 

var userObject = gs.getUser().getUserByID('UserID');//UserID is the employee id you need to enter

template.print(userObject.userObject.getFirstName());

 

 

Call the email script in the notification body where you want the name.

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Piyush Sain

MeharNaaz1_0-1697196060021.png

I want the above created by field which has Employee id as value at present to populate Employee Name in Email notification.

 

Hi @Mehar Naaz1 

Use this code below

var userObject = gs.getUser().getUserByID('current.sys_created_by');

template.print(userObject.userObject.getFirstName());

call the email script in Notification wherever you want the name to be visible.

For example if the name of script is abcd, so call it by ${mail_script:abcd}

If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Regards,
Piyush Sain

Anurag Tripathi
Mega Patron
Mega Patron

Hi,

You can add it as below

Navigate to the email in question and just add the below where you need the employee name

${caller_id.first_name}

 

You can even select the field using the tree on the right side

AnuragTripathi_0-1697195519976.png

 

-Anurag