Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Reference qualifier is showing only one value

Kumar147
Tera Contributor

Hello,

I am calling script include in reference qualifier and i am getting only one value, instead of showing related values.

script include i am using:

 

    platform: function() {
        var app = current.cmdb_ci.getValue();
        var gr = new GlideRecord('u_rm_data_management');
        gr.addEncodedQuery('u_active=true^u_type=Choice^u_item=App Platform^u_applicationsLIKE' + app);
        gr.query();
        var result = [];
        while (gr.next()) {
            result.push(gr.sys_id.toString());
            return 'sys_idIN' + result.join(',');
        }
    },
 
adv ref qual condition: javascript: new scriptinclude().fucntion();
 
Please help in this.
20 REPLIES 20

Tried but no luck.

 

Kumar147_1-1730209558054.pngKumar147_2-1730209565922.pngKumar147_3-1730209573044.png

 

I'm still not clear from your logging if the correct records are being returned by the GlideRecord in all test cases.  The field changing to a choice is likely an attribute.  If you don't want that, clear the Attributes field or use something basic/standard like 

edge_encryption_enabled=true,encode_utf8=false

 

Tried but no luck. initially i tried 

javascript: 'u_app_applicationsLIKE'+current.cmdb_ci; within the reference qualifier but it worked on while on Load, not while on Change.

That's a good point - if the Script Include is only doing a query on the same table, try the same query without it.  If any reference qualifier works when the form loads, but not when a field mentioned in the qualifier changes, try adding to the end of your Attributes

,ref_qual_elements=cmdb_ci

 

swati swagatika
Tera Contributor