- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2024 09:55 PM
I have been asked with creating a user selection form in ServiceNow where the list of users displayed depends on the selected location. Using Jelly scripting and JavaScript, implement a solution that dynamically updates the reference qualifier for the user field based on the location selected by the user.
- Instructions:
- Implement a Jelly script that creates a reference field for selecting a location from the cmn_location table.
- Add another reference field to select a user from the sys_user table, which should be filtered dynamically based on the selected location.
- Ensure that when a location is selected, the reference qualifier for the user field is updated to only show users associated with that location.
- Include JavaScript logic to handle the dynamic filtering based on the selected location.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2024 07:01 AM
Hello,
you can write the below script in the UI page:-
HTML :-
and Client Script as :-
It should work Ex:-
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
YouTube: https://www.youtube.com/@learnservicenowwithravi
LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2024 07:01 AM
Hello,
you can write the below script in the UI page:-
HTML :-
and Client Script as :-
It should work Ex:-
If you found my response helpful, I would greatly appreciate it if you could mark it as "Accepted Solution" and "Helpful."
Your support not only benefits the community but also encourages me to continue assisting. Thank you so much!
Thanks and Regards
Ravi Gaurav | ServiceNow MVP 2025,2024 | ServiceNow Practice Lead | Solution Architect
CGI
M.Tech in Data Science & AI
YouTube: https://www.youtube.com/@learnservicenowwithravi
LinkedIn: https://www.linkedin.com/in/ravi-gaurav-a67542aa/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2024 08:23 AM
This isn't what you asked but is there a reason you're using jelly script and a UI Page? You could do this using g_modal, which has the advantage of being supported in workspace as well. See the link below to another community page.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2024 12:11 PM
As @KevinBellardine mentioned, why the requirement for Jelly? And what exactly do you mean by "a user selection form"? What is the "form" used for? What's the use case?
The "Instructions" are a bit odd: is this for a test/exam?