Calculated List field on User table shows sys_ids instead of group names

lidorz
Tera Contributor

Hi all,

I created a calculated List field on the User [sys_user] table that should display the groups the user belongs to.

  • Type: List

  • Reference: sys_user_group

  • Script returns the group.sys_id values from sys_user_grmember

Problem:

  • The field shows a comma-separated list of sys_ids, not group names

  • It doesn’t render as a list box — just as plain text

The setup seems correct, but the UI and values aren't working as expected.

Any ideas how to get it to:

  1. Show group display names

  2. Render as a proper List UI field

Thanks!

lidorz_0-1752162765063.png

 

lidorz_1-1752162785592.png

 

lidorz_2-1752162805349.png

 

lidorz_3-1752162824747.png

 

3 REPLIES 3

Anand Kumar P
Giga Patron
Giga Patron

Hi @lidorz ,

 

Line 10 change with below line 

 

groupIds.push(gr.group.getDisplayValue());

 

If my response helped, please mark it as the accepted solution and give a thumbs up👍.
Thanks,
Anand

hiii..
i did it, and now its shows nothing.

i wonder where the white box of list field is ...

lidorz_0-1752164000886.png

 

Muhammad Salar
Giga Sage

Hi @lidorz 
Don't use calculated value, Use onLoad client script GlideAjax to populate this Or any other way, by using this way, you can see display values and proper list field as well.

Calculated Fields Documentation - ServiceNow Community