- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2025 06:40 AM
I'm working on the following UI Page on a Business Application form:
When the user clicks on the reference field, I'm expecting any children of the Business Application. So where an Application Service has the current Business Application selected as 'Business Application Name', which is also a reference field.
I'm trying to use the following code to achieve this in the HTML part of my UI Page:
Does anyone know where I'm going wrong?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2025 09:10 AM
So based on current business app the filter should be applied
See this how I was able to show only incident assignment group in reference field
I passed the group sysId and collected that in UI page and then used query attribute to set the filter
You can also enhance for something similar for your case
UI Action:
var gm = new GlideModal('myTestingHtmlInput');
gm.setTitle('My Page');
gm.setPreference('sysparm_group', g_form.getValue('assignment_group'));
gm.setSize('600', '600');
gm.render();
UI Page:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate var="jvar_group" expression="RP.getWindowProperties().get('sysparm_group')" />
<g:ui_reference id="group" name="group" table="sys_user_group" query="sys_idIN${jvar_group}" completer="AJAXTableCompleter"/>
</j:jelly>
Output:
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2025 11:33 PM
Hi @Ankur Bawiskar Thanks very much. I've now accepted your solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2025 11:45 PM
Glad to help
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader