- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2024 02:20 AM
I have two reference fields on a form. one is platform and second one is CMDB. CMDB is on task table. platform field is getting data from data management table and CMDB is getting data from cmdb_ci table. data management table having a list field which is reference to CMDB. when CMDB field is filled i need the reference qualifier to show only records related to that CMDB field.
script include:
var app = current.cmdb_ci;
var gr = new GlideRecord(‘table name);
gr.addQuery(‘u_applications’, app);
gr.query();
var result = [];
while(gr.next()){
result.push(gr.sys_id);
return result;
}
advanced ref qualifier : javascript: new script include name().function();
please help in this.
Thanks in advance
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2024 05:45 AM - edited 10-28-2024 05:54 AM
Hi @Kumar147 ,
You have not followed my instruction.
Not sure why you are writing script include.
Just add below code in your reference qualifier of plateform filed. nothing else is required.
javascript:'u_cmdb_listLIKE'+current.cmdb_ci
replace "u_cmdb_list" with your field name which present on your data management table.
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2024 08:26 PM
Hi @Kumar147 ,
try below code
“javascript: ‘u_app_platform=‘+current.cmdb_ci”
2nd field name are you having cmdb_ci or something else? Put correct field name.
do share screenshots if does not work.
both field and reference qualifier .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2024 08:34 PM
Hello @Runjay Patel
2nd field name is cmdb_ci only. But its on task table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-27-2024 10:47 PM
Hi @Kumar147 ,
Then it should work, i had tested this. You can share the screenshots for your configuration.
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2024 04:15 AM - edited 10-28-2024 04:17 AM
Hello @Runjay Patel
I Have tried that but no luck. I am getting app value but still field is showing all values. please find the screenshots of script include and advanced reference qualifier.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2024 05:45 AM - edited 10-28-2024 05:54 AM
Hi @Kumar147 ,
You have not followed my instruction.
Not sure why you are writing script include.
Just add below code in your reference qualifier of plateform filed. nothing else is required.
javascript:'u_cmdb_listLIKE'+current.cmdb_ci
replace "u_cmdb_list" with your field name which present on your data management table.
-------------------------------------------------------------------------
If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.
Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay
-------------------------------------------------------------------------