Converting sys_id to a value

Tim Wmson
Giga Expert

I'm creating a catalog item to ask the submitter what group they want a user added to. I have it working except it returns the   sys_ID of the group to the Incident summary field. How do I convert this to the group name?

1 ACCEPTED SOLUTION

Ahmed Drar
Tera Guru
Tera Guru

Hi , if you set the group's name as Display value then getDisplayValue() is the solution for you or you can try var gr = new GlideRecord('sys_user_group');   if (gr.get(groupID))// add group ID here {   // gr.name returns group's name }


View solution in original post

14 REPLIES 14

Victor Ruiz
Tera Guru

Converted to a reference field.


trdaniels
Tera Expert

Hi Tim,



Did you get this working?


Yes. Ahmed had the winning answer


Rajasekar4
Tera Expert

Hi I am unable to fetch the List Collector Display value  from Client Enabled UI Action, i have tried the below code but no luck.can anyone help me on this.

1.g_form.getValue('v_members'); showing sysid not display value.
2.g_form.getDisplayValue('v_members'); not showing anything.
3.gr.getDisplayValue('v_members); gr is not defined.

Hi Rajasekar

Usually you dot walk with something like "current.assignment_group.getDisplayValue();" - you are getting the value with "gr.getDisplayValue();" and therefore leave the " ( ) " empty. So in your case, it could be something in the line of: "current.v_members.getDisplayValue();".



See below link, for getDisplayValue() in GlideRecord:

https://community.servicenow.com/community?id=community_question&sys_id=397d0fe9db9cdbc01dcaf3231f961990