UI Page: How to use IF statement in g:evaluate in Jelly based on dropdown list user selected?

bbf3562
Kilo Guru

How can I add code in g:evaluate using IF statement based on user select option from dropdown list? The IF statement will be if the user select role, it will call the sys_user_has_role table. If the user select group, it will call sys_user_group. I have tried use if(e.options[e.selectedIndex].value == "roles") but it doesn't work and it mess up the page.

find_real_file.png

find_real_file.png

1 ACCEPTED SOLUTION

Shahed Shah1
Tera Guru

The g:evaluate tags will allow you to run server-side code and access the usual server-side APIs (GlideRecord, GlideAggregate, etc).



So, it will not be able to plug into the client-side and get the currently selected value.



You will need to place your javascript code inside of the Client script portion of the UI Page or embed them within script tags.


View solution in original post

1 REPLY 1

Shahed Shah1
Tera Guru

The g:evaluate tags will allow you to run server-side code and access the usual server-side APIs (GlideRecord, GlideAggregate, etc).



So, it will not be able to plug into the client-side and get the currently selected value.



You will need to place your javascript code inside of the Client script portion of the UI Page or embed them within script tags.