- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2023 12:33 AM
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?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2023 01:09 AM
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();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2023 12:35 AM
can You please post your code here?
Regards, Shekhar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2023 12:39 AM
Hi @Yuval Lanton ,
The Assigned to is referenced to the sys_user table and if you access it you would get the sys_id of that user record.
If you want its full details then you need to do as below at server level
var assignedTo = current.assigned_to;
var userRecord = new GlideRecord("sys_user");
if(userRecord.get(assignedTo)){
current.previous_assigned_to = userRecord.name; //If you want name to be populated.
//Fill in what ever you need from the userRecord object
}
If you want at client level you need to do Client Script + Display BR (or) client script + Script include.
Let me know if you want more details on how to do via client side.
Please mark correct if my response has solved your query.
Cheers,
Mohammed Basheer Ahmed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2023 01:03 AM
use getDisplayValue() to show the display value of that reference field.
example : current.assigned_to.getDisplayValue();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2023 01:06 AM
Hi,
I guess your firld 'Previously assigned to' is of type string. Change type to reference and use sys_user table as reference table.