Add the current user groups and role on the related list on RITM form

Neil_Carlo24
Tera Contributor

Hello,

How to add the current user's(request for) groups and roles on the related list of the RITM form of my User Offboarding Catalog item.

 

 

1 ACCEPTED SOLUTION

Anil Lande
Kilo Patron

Hi,

Can you please share what is business use case behind this?

As Requested Item table is used for many catalog items and it may be irrelevant to show users group and roles in all RITMs related list.

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

View solution in original post

10 REPLIES 10

Anil Lande
Kilo Patron

Hi,

Can you please share what is business use case behind this?

As Requested Item table is used for many catalog items and it may be irrelevant to show users group and roles in all RITMs related list.

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Hello @Anil Lande 

Forgot to mention i want to put this on my User Offboarding catalog item.

Hi,

You can create custom Relationships like below:

For Roles:

Screenshot 2024-01-23 at 12.11.17 PM.png

 

For groups:

 

Screenshot 2024-01-23 at 12.12.29 PM.png

 

To learn more check below links:

https://www.servicenow.com/community/developer-articles/servicenow-create-custom-related-list-servic...

https://docs.servicenow.com/bundle/vancouver-platform-user-interface/page/administer/form-administra...

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

Once you add custom related list on Requested Item form then you need to create one OnLoad client script that will Hide these lists on other requested Items.

 

https://www.servicenow.com/community/spm-forum/how-do-i-hide-a-related-list-on-load/m-p/1039606

 

You Logic in client script would be:

if(g_form.getValue('cat_item') != 'sys_id of Onboarding catalog item'){

g_form.hideRelatedList('REL:453086932f7fb950ae17debcf699b661');  // find the name or sys_id or related list 

}

 

Find name of Related list :

by checking <sys_ui_related_list> table records.

Screenshot 2024-01-23 at 12.21.45 PM.png

 

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande