Mobile scripting in offline

concept australia Updated Oct 28, 2026 1 min read mobile-script-concept.md
Raw file servicenow.com

Use mobile scripts to run reusable JavaScript on the user’s device while offline, so offline buttons and write-back actions stay consistent with online behavior. Mobile scripts are a subset of web scripts, and are stored centrally on the instance. The platform pushes them to mobile devices as part of the offline cache.

Mobile scripts, which is a subset of web scripts, are reusable JavaScript code written to run in ServiceNow mobile apps, including while the device is online. Each script is stored centrally on the instance in the Mobile script [sys_sg_mobile_script] table, and the platform pushes it to mobile devices as part of the offline cache. You can call these scripts for mobile components, such as button conditions and write-back actions.

The model is similar to Script Includes, which are reusable server-side JavaScript that you define once and call from any script that needs it. A Script Include runs only when another script explicitly calls it, rather than running automatically in response to a platform event like a record insert. Mobile scripts follow the same reuse pattern, though they run on the device instead of the server.

Note: Mobile scripts created before the Brazil release continue to run. We suggest that you update your scripts and use the Brazil version-related syntax. Scripts you don’t update currently function, but ServiceNow doesn’t support any capabilities that stop working.

Button conditions and write-back actions with mobile scripts

Mobile scripts can be triggered from button conditions and write-back actions, which are the currently supported components. For more information, see Button condition support enablement and Write-back action support.

Reference material

: For details about mobile scripts’ supported components, available classes and other API requirements.

Parent Topic:Offline mode

Search documentation
Search document titles and file paths on the australia branch