Define and associate a script with a remote table so that you can retrieve data from an external source with it. The ServiceNow AI Platform retrieves and caches the data for the remote table by running the script against an external data source so you can view or modify it. You can also designate how this external data is cached and how long the data is cached in memory until the script must run again.

Before you begin

Role required: admin

About this task

You create script definitions for remote tables like you do for other scripts. To learn more about entering, modifying, and debugging scripts, see JavaScript syntax editor.

Procedure

  1. Navigate to All > System Definition > Remote Tables > Definition.
  2. Click New.
  3. On the form, fill in the fields.
  4. In the Script section, add your JavaScript syntax to the skeleton template:
    Note: The Script section shows up only when the Flow field is empty.
    Remote table script editor template
    Note: To learn more about entering, modifying, and debugging scripts, see JavaScript syntax editor.
  5. In the Caching section, designate how this data is cached and how long the data is cached in the memory of the ServiceNow AI Platform:
    Field Description
    Cache TTL Cache time to live, expressed in seconds, that external data is cached in memory for this remote table script definition. For example, enter 300 to cache the data in the memory for 5 minutes.

    The maximum value you can enter is 60 minutes (3600 seconds).

    Enhanced Capacity Option to select the enhanced capacity to support more than 1000 rows in a remote table.
    Note: If the data size that is retrieved from the external source is small, use the 1000 rows default limit in a remote table to minimize query times. You can select the Enhanced Capacity field if the retrieved data size is large and can be less performative.
    Note: By default, the external data is cached in the memory by user.
  6. Click Submit.

Result

When you activate a script definition, you associate it with the remote table so that you can retrieve and cache the external data.