Response Template: How to add current user name?

Niclas
Giga Guru

In the Response Template, is it possible to insert the current users name or to invoke a script?

Typical example would  be to insert some signature like "Best regards, <Name of User>"

1 ACCEPTED SOLUTION

There is a new "Insert current User" button available since Paris, see docs

find_real_file.png

View solution in original post

8 REPLIES 8

Yash Agrawal1
Tera Guru

Hello  niclas6692

If You Want a Current user information  in client side script then use Glide User Api's that is g_user.Which gave you all the information about currently logged in users on client side.

 For getting currently logged in  users name on client side use : g_form.getUSerName() Method

For getting currently logged in  users name  on Server side use : gs.getUserDisplayName() Method

 

Please Mark it  helpful/correct

On the Response Template you have a HTML field where you type in the text. As it is an HTML field I can not use Client Script code.  Using <script> </script> parts will be removed from the source code of the HTML field.

 

They have the variable ${Date} to insert the current date. I'm wondering if there are other variables like ${User} to insert the currents user name. 

Hi niclas6692,

 

The templates we have use the following code for signing standard responses:

${assigned_to.first_name}

 

Our agents can then just apply the templates without typing anything.

 

Hope this helps!

Lena_Latham
ServiceNow Employee
ServiceNow Employee

This page in Docs details the no-code way to achieve this: https://docs.servicenow.com/bundle/madrid-servicenow-platform/page/product/human-resources/task/crea...

 

Best regards,

Lena