- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
What Are Mobile Callable Script Includes?
A Mobile Callable Script Include is a ServiceNow Script Include that is intended to be run inside the context of a mobile app. By designating a Script Include as mobile callable, developers can expose server-side code that can be smoothly triggered from mobile devices. This brings up new opportunities for developing fast, lightweight, and mobile-friendly solutions.
Key Features
1. Mobile-Specific Functionality
These Script Includes are designed specifically for mobile use scenarios. They can be triggered by mobile app components such as actions, events, or buttons, resulting in seamless integration of mobile processes with backend logic.
2. Optimized for Performance
Mobile Callable Script Include is expected to run swiftly and efficiently. This ensures that users have a seamless experience when using the ServiceNow mobile app.
3. Secure Execution
ServiceNow uses strict security checks to ensure that only authenticated users and approved applications may access these Script Includes.
4. Scoped Application Support
By supporting Scoped Applications, this feature enables developers to maintain the modularity and organization of their mobile-specific logic.
Enabling Mobile Callable Script Includes
To mark a Script Include as mobile callable, follow these simple steps:
-
Navigate to System Definition > Script Includes in your ServiceNow instance.
-
Open an existing Script Include or create a new one.
-
Check the box labeled Mobile Callable.
-
Save the Script Include.
Example: Retrieving Open Incidents for a User
Here’s a simple example of a mobile callable Script Include:
var MobileIncidentHelper = Class.create();
MobileIncidentHelper.prototype = {
initialize: function() {},
getOpenIncidents: function() {
var result = [];
var gr = new GlideRecord('incident');
gr.addQuery('assigned_to', gs.getUserID());
gr.addQuery('state', '!=', 6); // Exclude closed
gr.query();
while (gr.next()) {
result.push({
number: gr.getValue('number'),
short_description: gr.getValue('short_description'),
state: gr.getDisplayValue('state')
});
}
return result;
},
type: 'MobileIncidentHelper'
};
How It Works
-
Initialization: The Script Include is created and marked as mobile callable.
-
Query Execution: The
getOpenIncidents
function retrieves all open incidents assigned to the current user. -
Return Results: The results are formatted as an array of objects and returned for use in the mobile app.
Why Use Mobile Callable Script Includes?
Enhanced User Experience
By optimizing server-side logic for mobile apps, you can deliver fast and responsive experiences to your users.
Streamlined Development
Mobile Callable Script Includes simplify the development of mobile features by providing a clear, structured way to integrate backend logic with the mobile app.
Security and Reliability
ServiceNow’s built-in security ensures that your mobile callable scripts are safe and reliable.
Regards,
Harsh Deep Singh
Mark 👍 Helpful if you find my response worthy based on the impact.
- 936 Views
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.