how to populate employee name in email notification form employee id
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2023 04:04 AM
how do i populate employee name in email notification form employee id.Can anyone suggest a solution? Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2023 04:10 AM - edited 10-13-2023 04:13 AM
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.
Regards,
Piyush Sain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2023 04:22 AM
I want the above created by field which has Employee id as value at present to populate Employee Name in Email notification.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2023 05:22 AM
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}
Regards,
Piyush Sain
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2023 04:12 AM
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