- 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-09-2025 06:46 AM
so the reference field should show filtered results?
if yes then based on what?
From where are you calling this UI page?
what's your actual business requirement?
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-09-2025 06:51 AM
Yes. That is correct.
It's based on the business application that the user has currently got open.
It's coming from a UI Action.
- 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-10-2025 06:10 AM
Hope you are doing good.
Did my reply answer your question?
I believe I have answered your question and you can enhance it further.
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