Calling a Script include in another script include
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2021 05:45 AM
Hi,
I need to know how to pass parameters in script include by calling a script include inside another script include?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2021 05:52 AM
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2021 09:17 AM
Hi,
could you please help me with passing parameters with example script if possible.
Regards,
Dhareene

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2021 09:31 AM
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2021 10:00 AM
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.