How to call a script include in the mobile app

Elvin_Salim
Tera Contributor

I'm trying to call a script include in a field in the mobile app, but it doesn't seem to work. The script include is a client-callable and I'm trying to call it in the field's conditions.

Elvin_Salim_0-1748865196472.png

 

4 REPLIES 4

rohansargar
Kilo Guru

Hello @Elvin_Salim,

 

In ServiceNow Mobile (using the Mobile App or Agent Mobile), you cannot directly call a Script Include inside field conditions or UI policies like you would on the web interface. The mobile framework has a more restricted execution environment — especially for logic embedded directly in field conditions, visibility conditions, or client logic.

 

If my response helped, mark it as correct.

Best regards,

Rohan

Hello @rohansargar,

 

Do you have any recommendations on how to call a Script Include in the field on mobile?
I have a field that calls a script include in the web interface (The script includes filters and displays records based on the user's region.), and how do I implement the same on mobile?

 

BR,

Elvin

 

Hello @Elvin_Salim,

Create a new Data Item:

Type: Script Include
Name: Get User Region Locations
Script Include: RegionFilterHelper
Function: getFilteredRecords
HTTP Method: GET

This allows the mobile client to call your server logic.


BR,

Rohan

Hello @rohansargar,

 

There is no Type: Script Include (only Condition type: script ) and also HTTP Method in the data item.

Elvin_Salim_0-1749041635233.png

 

Should it be like this way?

 

BR,

Elvin