Calling a Script include in another script include

dhareene
Tera Contributor

Hi,

I need to know how to pass parameters in script include by calling a script include inside another script include?

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

yes this is possible.

Just while you invoke the function from another script include you can pass the parameters

check this link and response from Avinash for explanation

can we call scriptinclude inside script include and

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi,

could you please help me with passing parameters with example script if possible.

Regards,

Dhareene

Allen Andreas
Administrator
Administrator

Hi,

So in your first script include, at whatever point you want to call your other script include you'd simply do something like:

var si = new scriptincludename().functionname(pass parms);

Your return result from that 2nd script include will be associated with variable 'si'.

Other documentation located here: https://docs.servicenow.com/bundle/quebec-application-development/page/script/server-scripting/conce...

and if you're calling this script include from outside of it's scope (first you need to make sure it's accessible by the scope you're calling it from (via the script include record/settings) and then you'd use a call like:

var si = new scopename.scriptincludename().functionname(pass parms);

Please mark reply as Helpful/Correct, if applicable. Thanks!


Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

Hi,

Thank you for the response.

I have 3 script includes first 2 are in same scope and the third script include is in the another script include. But when I try to call the second script include in third one its not working.

Please add your suggestion.