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.

Call script include from Module Arguments

Ronak Jhaveri
Kilo Expert

Hi All

I am trying to call script include from Module arguments but it does not get called. 

Is there anyother way to call script include from arguments

find_real_file.png

find_real_file.png

 

1 ACCEPTED SOLUTION

Harsh Vardhan
Giga Patron

just confirming here,

 

script include has created in scoped application ?

 

if yes then add scope before the script include 

 

example:

 

&sysparm_fixed_query=company=javascript:gs.getUser().getCompanyID()^location.sys_idINjavascript:new <scope>.getmappedlocation().getmappedlocation();

 

 

View solution in original post

6 REPLIES 6

Elijah Aromola
Mega Sage

You need to add "new" in front of your script include call. So "new getmappedlocation();"

Please mark this as correct/helpful if it resolved your issue!

You mean like below

&sysparm_fixed_query=company=javascript:gs.getUser().getCompanyID()^location.sys_idINjavascript:new getmappedlocation();

I tried with this as well, but it does not get called.

Hello Ronak,

try with this code:

&sysparm_fixed_query=company=javascript:gs.getUser().getCompanyID()^location.sys_idINjavascript:new getmappedlocation().getmappedlocation();

 

May be you need to change a function name. can you try changing a function name from script include. Sometimes it may cause a issue

Please mark as Correct Answer/Helpful, if applicable.
Thanks!
Abhishek Gardade

Thank you,
Abhishek Gardade

No luck. Even after creating new script include call does not go to script include.