- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2023 10:27 PM
Hi,
I want to display the name of the created by instead of user id, below script dispalying the user id of the record in the email notification. could you please help me
Application ${name} created by ${sys_created_by} with MRC Accreditation ${u_mrc_acc}.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2023 11:20 PM
Hi @sushmachava
You need to query the user table with user id details and get the name.
Write a mail script with below logic and include in body of the notification.
var grSysUser = new GlideRecord('sys_user');
grSysUser.addEncodedQuery("user_name=" + current.sys_created_by);
grSysUser.query();
if (grSysUser.next())
template.print("Application" + current.name + "created by " + grSysUser.name + " with MRC Accreditation " + current.u_mrc_acc);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2023 11:12 PM
Hi @sushmachava ,
Created by is a system created (OOB) string field type and populated when record is inserted to database (i wouldn't recommend to change this logic to display Name instead user id)
Can you use Opened by instead >> ${opened_by} which gives Name.
Thank you,
Hemanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2023 11:20 PM
Hi @sushmachava
You need to query the user table with user id details and get the name.
Write a mail script with below logic and include in body of the notification.
var grSysUser = new GlideRecord('sys_user');
grSysUser.addEncodedQuery("user_name=" + current.sys_created_by);
grSysUser.query();
if (grSysUser.next())
template.print("Application" + current.name + "created by " + grSysUser.name + " with MRC Accreditation " + current.u_mrc_acc);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2023 11:47 PM
Thanks Voona