How can I display the first name, last name, and email address in the Name column for the user table.

JR Guieb
Tera Expert

How can I display the first name, last name, and email address in the Name column for the user table.   Currently the the requested for variable is referencing the users table and displays the name field which only has the user's first and last name.   The issue we are having is that we have some users with the same name and the end user submitting an incident or request cannot distinguish which person to choose.   I do not have a good grasp at scripting so any help would be great.

Here is what we have for the script for the name column:

if (current.first_name.nil() && current.last_name.nil() && !current.name.nil()) {

  var names = current.name.toString().split(" ");

  if (names.length > 1) {

      current.first_name = names[0];

      names.shift();

      current.last_name = names.join(" ");

  } else

      current.last_name = names[0];

}  

if(current.first_name.nil()) {

      current.last_name;

  } else {

      current.first_name + ' ' + current.last_name;

  }

1 ACCEPTED SOLUTION

Brad Bowman
Kilo Patron
Kilo Patron

I was experiencing the same display discrepancy between the Service Catalog and ESS, and the new Service Portal until I made my Variable attributes the following:



ref_auto_completer=AJAXTableCompleter,ref_ac_columns=email,ref_ac_columns_search=true,ref_ac_order_by=name



The search and order by may not be necessary.   Now I am seeing name and email in the reference drop-down - though it seems to stack the email address beneath the name, not to the right.


View solution in original post

11 REPLIES 11

Sandy1
Tera Contributor

Hi, 

 

Can this be achieved if the field is a choice field (drop-down with None)?

 

Thanks, 
Sandeep

soumya17
Tera Contributor

did you find any solution for changes in calculated value?