The CreatorCon Call for Content is officially open! Get started here.

Calling a private scope script include with scoped app

Monish2
Tera Contributor

Hi ServiceNow Experts,

I am developing a scoped app and have a requirement of executing a script include which is only accessible from a particular scope. This SI needs an input param to be passed dynamically every time scoped app is executed. The scope of SI cannot be changed to "accessible to all scopes".

What are ways of executing this SI from a scoped app?

 

Thanks!

8 REPLIES 8

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

As per my understanding the script include can only be invoked from outside the scope once you make it Accessible from all scopes

Other than that I don't think anything can be done

Let's wait for other members to comment.

Regards
Ankur

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

OlaN
Giga Sage
Giga Sage

Hi,

That will be a tricky one.

A workaround would be to create another script include in the other scope, and set it to be accessible to all scopes. 

And then in that new script include, call the script include, which is only accessible from within the same scope.

Markus Kraus
Kilo Sage

PN me, i will write you a script that allows you to do this. I am not going to post this publicly here because this is 

  1. A big security issue
  2. Will be patched (hopefully) in the future

EDIT: Seems there is no Personal Message functionality in this forum? If you send me your mail i'll send you the hack

Monish2
Tera Contributor

Thanks everyone for your help.

I got a workaround. I am creating/updating a sys property with the required input value using the scoped app. I have also created a scheduled job within the scope where SI is available. This Job picks the input value from sys property and executes the private SI.