---
sourceDocument: Brazil Mobile Configuration and Navigation
sourceDocumentLink: https://www.servicenow.com/docs/r/mobile

 Release :

    - brazil

ft:locale :

    - en-US

ft:publication_title :

    - Brazil Mobile Configuration and Navigation

ft:clusterId :

    - mobile

bundleId :

    - mobile

workflow :

    - Development, Data and Analytics


---

# Reference field attributes

# Reference field attributes for input form screens in offline mode {#ariaid-title1}

Release version: Brazil  
Updated September 10, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of Reference field attributes for input form screens in offline mode

This feature enables ServiceNow customers to configure reference fields on input form screens for offline use.
By defining specific attributes, you can control which data is displayed and how users search and interact with reference fields when offline.
This improves offline usability by ensuring relevant data is cached and accessible without an active connection.
Show full answer Show less  

## Key Features

* **Input form screen setup:** You must first create an input form screen before adding reference variables and configuring attributes.
* **Reference inputs:** These inputs behave like standard reference fields, linking to records in a specified table with support for qualifiers and search options.
* **Required attributes:**
  * **SourceTable:** Specifies the source table for the reference qualifier.
  * **SourceFieldName:** Specifies the field name in the source table that is referenced.
  * **TargetTable:** Defines the table targeted by the reference qualifier.
* **Optional attributes:**
  * **OfflineMobileViewId:** Specifies the mobile card layout to display reference data offline, overriding MobileViewId.
  * **EnableSearch:** Controls whether the search bar is shown; values are `true` or `false`.
  * **OfflineConditions:** Encoded query conditions for filtering reference data offline; takes precedence over online Conditions.
  * **SearchType:** Defines search behavior as `startswith` or `contains`; defaults to `startswith`.
  * **OfflineFetchScript:** Allows specifying a custom script to select which reference records (up to 1,000) to cache offline, ensuring relevant data is available.
  * **OfflineMaxNumRecords:** Sets the maximum number of records to cache offline per reference input, capped at 1,000.

## Practical Application Example

To optimize offline caching for the "Assigned To" reference field, a Script Include can be created that dynamically retrieves active users sharing the logged-in user's location. This script returns a list of user Sys IDs (up to 1,000) to cache while offline, ensuring users can assign records efficiently without connectivity.

Implementation involves:

* Creating a Script Include defining a method to gather relevant user Sys IDs.
* Adding the `OfflineFetchScript` attribute to the "Assigned To" input field, calling the custom script to specify cached records.

## Benefits for ServiceNow Customers

* Improves offline user experience by caching targeted, relevant reference data.
* Reduces data volume by limiting cached records to necessary subsets.
* Supports custom filtering and search options tailored to offline use cases.
* Maintains consistency with online reference field behavior while enhancing offline functionality.  
Configure the fields that you want to use and the data you want to display in offline
mode by using various input attributes.
Note:  
You must create an input form screen before you create variables and attributes. For information about creating an input form screen, see [Configure an input form screen](https://www.servicenow.com/docs/2J9PC~h_NDt4dHKj97dr2g "Configure an input parameter so that your users can see a list of records from their mobile app. To access a record from the list, a user just has to tap the record name.").

## Reference inputs {#reference-fields-offline-attributes__section_itt_mzd_15b}

Use reference inputs for inputs that reference a field on a table. These inputs work like [reference fields](https://www.servicenow.com/docs/access?context=c_ReferenceField&version=brazil&pubname=brazil-platform-administration&ft:locale=en-US) in the forms on your instance. You can configure your reference input with conditions, reference qualifiers, and a search option to help your users find what
they need quickly.

You can use these attributes with reference inputs.  
Note:  
All attributes are case-sensitive.
{#reference-fields-offline-attributes__table_pn1_xdt_v4b__entry__2}

| Attribute | Description |
|-|-|
| SourceTable | The source table for your reference qualifier. |
| SourceFieldName | The field name of the referenced field in the source table. |
| TargetTable | The table you want to target for your reference qualifier. |
[Table 1. Required attributes]

{#reference-fields-offline-attributes__table_pn1_xdt_v4b}

The following additional attributes are optional:
{#reference-fields-offline-attributes__table_anh_jbw_b4b__entry__2}

| Attribute | Description |
|-|-|
| OfflineMobileViewId | Define the mobile card used to display reference field data in offline mode. The OfflineMobileViewId attribute takes precedence over the MobileViewId attribute. |
| EnableSearch | Option to determine whether the search bar displays. The value must be true or false. |
| OfflineConditions | Encoded query condition used to query the reference data. The OfflineConditions attribute takes precedence over the Conditions attribute. Note: This attribute can also be used when the Conditions attribute has a condition that can't be supported in offline. |
| SearchType | Defines the query used for search. The value can be <kbd class="ph userinput">starts_with</kbd> or <kbd class="ph userinput">contains</kbd>. If this attribute is not configured, the instance uses <kbd class="ph userinput">starts_with</kbd> by default on the display label column. |
| OfflineFetchScript | Use to specify a list of Sys IDs for reference records. Using this attribute, you can define what records to cache while in offline mode. Reference fields can return many thousands of records, but only 1,000 records are supported to cache for offline mode. Use this attribute to define the specific records (1,000 or less) that you want to cache for use while offline. If this attribute is not used, then the first 1,000 records returned are cached. An example script is shown in the next section. |
| OfflineMaxNumRecords | Defines the number of records that you can cache in offline mode. The maximum number is 1000. You can set a different value for each reference input. |
[Table 2. Additional attributes]

{#reference-fields-offline-attributes__table_anh_jbw_b4b}

## OfflineFetchScript implementation example {#reference-fields-offline-attributes__section_kq5_z1g_njc}

This example shows how the system dynamically retrieves users who share the logged-in user's location for the Assigned Tofield in the input form.

1. Create a Script Include to return active users in the same location as the logged-in user, plus the user themself.

       var MobileOfflineUserFetch = Class.create(); 
       MobileOfflineUserFetch.prototype = { 
           initialize: function() {}, 
        
           getUsersByMyLocation: function() { 
               var ids = []; 
               var myId = gs.getUserID(); 
               var myLoc = gs.getUser().getLocation(); 
        
               ids.push(myId); // include myself 
        
               if (!myLoc) 
                   return ids.join(','); 
        
               var gr = new GlideRecord('sys_user'); 
               gr.addActiveQuery(); 
               gr.addQuery('location', myLoc); 
               gr.setLimit(1000); // Reference field limitation 
               gr.query(); 
        
               while (gr.next()) { 
                   ids.push(gr.getUniqueValue()); 
               } 
               return ids.join(','); 
           }, 
        
           type: 'MobileOfflineUserFetch' 
       }; 

2. Add the OfflineFetchScript input attribute to the Assigned To input field and set the value to the following:

       javascript: new MobileOfflineUserFetch().getUsersByMyLocation()

{#reference-fields-offline-attributes__ol_c44_cbg_njc}

