Reference qualifier is not working as expected.

Kumar147
Tera Contributor

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

1 ACCEPTED SOLUTION

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

-------------------------------------------------------------------------

View solution in original post

9 REPLIES 9

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 .

Hello @Runjay Patel 

2nd field name is cmdb_ci only. But its on task table.

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

-------------------------------------------------------------------------

In this video i have explained about Web service integration in ServiceNow like how it works, how we can configure it, what are the prerequisite and many more. I have covered below topics in this video. 1. understand Web Service. Like when and how we will use it. 2. Talked about Inbound and ...

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.

 

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

-------------------------------------------------------------------------