Need help with Jelly script in UI Page using dropdown options

bbf3562
Kilo Guru

Hello! I am still new to Jelly script. Originally, I created a UI page that get email addresses based on users who have specific role. When admin type role name in reference field then click button to get all email addresses from role that admin typed in. Now my manager wanted me to add assignment group as an option to get email addresses. So I am creating a dropdownlist for user to select and now I am stuck unsure how to populate a ui reference field depend on options admin pick. Like if Roles is selected, the ui reference field of Roles appear. If the Queue Groups is selected, the ui reference field change to Groups. I assume I need to use <j:if test="analyst == sys_user_has_role" > with <g:ui_reference name="test" table="sys_user_role" field="name"/> to change the ui reference based on option user selected? the Here is 2 examples I created in UI page so far,

find_real_file.png

find_real_file.png

Here a Jelly and Client script,

find_real_file.png

find_real_file.png

1 REPLY 1

nagaraniracharl
ServiceNow Employee
ServiceNow Employee

How about creating two reference fields one for Roles table and other for Groups table?


You can show/hide them as per the option selected using client script then.