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.

Pass variable to script include from reference qualifier

robhaas
Tera Contributor

I have an advanced reference qualifier calling a script include and passing it current.

javascript:new global.COMP_UserHelpers().showInactive(current);

I am needing to pass a different variable to the script include. Is it possible to define and pass this variable in the reference qualifier? I tried the following two permutations in attempt to pass the variable tmpShowInactive with no luck. Any thoughts?

javascript:new global.COMP_UserHelpers().showInactive(var tmpShowInactive = {u_show_termed_users : true});

javascript:var tmpShowInactive = {u_show_termed_users : true} new global.COMP_UserHelpers().showInactive(tmpShowInactive);

TIA for assistance.

11 REPLIES 11

robhaas
Tera Contributor

Balarammfs,



For the specific field on the form, I used the reference qualifier



javascript:new global.COMP_UserHelpers().showInactiveBool('true');



Here is the script include:



var COMP_UserHelpers = function(){



  function showInactiveBool(bool){


  //Check to see if parameter is true, if so show inactive.   If false, show only active.


  if (!bool) {


  return 'active=true';


  }


  return ''; // send empty string (not null)


  }


};




Let me know if that helps you.


Hi Robert,



i have one issue,


I want to send url parameters from variable reference qualifier to Script include.is there any solution for this scenario.