- 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 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 01:48 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-25-2023 05:12 AM
I found a solution to my problem.
Thank you anyway 🙂