sys_group_has_role in list collector variable

NaoyaT
Tera Expert

We would appreciate your help.

When I reference sys_group_has_role.list in the list collector variable, it shows the date the role was created.
If this is all, it is possible to display the role name at the same time by the attributes of the variable, but when I select a role, it is displayed only by date.
If there is a way to display by role name, I would appreciate it if you could please let me know.

1 件の受理された解決策

senon
Tera Sage

A straightforward solution is to set the "Role" field in [sys_group_has_role] as the Display Value.

When setting values for reference fields or variables, the field displayed is the one where the Display Value is marked as True.

In the screenshots below, which are taken from my Personal Development Instance (PDI), all Display Values are set to False.

senon_1-1743382960854.png

 

Therefore, in the following example, the SysID appears as the Display Value. (Please note that these screenshots show how the catalog is displayed in the platform interface, not on the portal. The appearance of the variable you configured may differ. However, rest assured, this variable is a List Collector referencing sys_group_has_role.)

 

senon_7-1743383834386.png

 

 

Next, I set the Display Value of the "Role" field in sys_group_has_role to True.

senon_4-1743383207609.png

 

As a result, the role names should now be displayed.

senon_6-1743383363612.png

Please note that this change will affect the display value of all fields and variables referencing [sys_group_has_role].

best regard.

 

 

元の投稿で解決策を見る

5件の返信5

@senon さん

本件につきまして、追加で質問させていただけますでしょうか。

 

ご案内いただいた手順は、ServicenowのOOTB設定を変更することになるため、sys_group_has_roleを参照する別のフィールドが必要となった時などに影響を都度考慮する必要があります。また、バージョンのアップグレード等による影響が計り知れません。

 

つきましては恐れ入りますが、カタログスクリプトなど別の方法で、表示を日付からロール名に変更することは可能でしょうか。

 

最終的には、グループを選択する参照フィールドで、選択したグループが所有するロールをリストコレクタで選択する流れにしたいと考えております。

 

NaoyaT_0-1743661611215.png

 

en------------------

Can I ask an additional question regarding this matter?
The procedure you have described will change Servicenow's OOTB settings, so we need to consider the impact each time we need another field that references sys_group_has_role, for example. Also, the impact of version upgrades, etc. is immeasurable.
Therefore, we would like to know if it is possible to change the display from date to role name by some other method, such as a catalog script.
Ultimately, we would like to have a reference field to select a group, and a list collector to select the roles owned by the selected group.