Best Practices for Using UI Actions and Script Includes Across Scopes in ServiceNow

AnjalPDijo
Tera Guru

When working across different application scopes in ServiceNow, it's important to ensure proper configuration for UI Actions and Script Includes to function as expected. Here are a few key points to keep in mind:

 

  1. Using a UI Action from Another Scope:

    • If you're referencing a UI Action from a different scope, make sure:
      • The table it’s associated with has “Accessible from other application scopes” checked under the Application Access tab.
      • The UI Action itself is marked as “Accessible from all application scopes”.
  2. Calling a Script Include from a Business Rule (Different Scope):

    • When invoking a Script Include from a Business Rule that resides in a different scope:
      • Prefix the Script Include name with sn_ (e.g., sn_MyScriptInclude) to ensure proper cross-scope access.

These small but crucial configurations help avoid scope-related errors and ensure smooth functionality across scoped applications.

3 REPLIES 3

Ravi Gaurav
Giga Sage

Hi @AnjalPDijo 

 

When building solutions that span multiple application scopes, a few key configurations ensure that your UI Actions and Script Includes work correctly.

1. Using a UI Action from Another Scope

If a UI Action is defined in a different scope:

  • Ensure the table it’s linked to has “Accessible from other application scopes” checked under the Application Access tab.

  • The UI Action itself should be marked as “Accessible from all application scopes.”

This allows other scoped applications to execute or reference that UI Action safely.

2. Calling a Script Include from Another Scope

If a Business Rule, UI Action, or Flow in one scope needs to call a Script Include from another:

  • Prefix the Script Include name with sn_ (for example, sn_MyScriptInclude).

  • This prefix tells the platform to look for the Script Include in a different scope that has been set to “Accessible from all application scopes.”

Ankur Bawiskar
Tera Patron

@AnjalPDijo 

is this an information or a question?

Hi @Ankur Bawiskar ,
Thanks for asking! This was just something I wanted to share from my experience — not a question. Hope it helps someone working across scopes.