convert sys id

Yuval Lanton
Tera Contributor

Hi.

I am trying to auto populate the 'Previously assigned to' field with the value of the 'Assigned to' field , but i get only sys id.

How do I convert the sys id to the value I need?

1 ACCEPTED SOLUTION

If you are using server script then and you don't want reference field then use below logic.

 current.u_previously_assigned_to = current.assigned_to.name;

or 

current.u_previously_assigned_to = current.assigned_to.getDisplayValue();

View solution in original post

7 REPLIES 7

If you are using server script then and you don't want reference field then use below logic.

 current.u_previously_assigned_to = current.assigned_to.name;

or 

current.u_previously_assigned_to = current.assigned_to.getDisplayValue();

Ankur Bawiskar
Tera Patron
Tera Patron

@Yuval Lanton 

Unfortunately you didn't share complete details

1) Previously assigned to field is of what type

2) What is your script

If Previously assigned to field is String type then ensure your script sets the display value/name of the user

If Previously assigned to field is Reference type then your script should work fine and you should set sysId only

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

I found a solution to my problem.

Thank you anyway 🙂