DynamicSchemaAPI - Global

concept brazil Updated Sep 10, 2026 2 min read DynamicSchemaAPI.md
Raw file servicenow.com

The DynamicSchemaAPI provides methods to clear the various caches used by the dynamic schema implementation.

You must have the dynamic_schema_writer role to execute any of the clear() methods.

Note: You shouldn't need to call the clear() methods in a production environment. Use these methods when you are troubleshooting your implementation if you think there is a possible caching problem causing stale data.

See also Dynamic Schema.

Parent Topic:Server API reference

DynamicSchemaAPI - clearDynamicCategoryCache()

Clears the entire dynamic category cache (DynamicCategoryCache).

DynamicCategoryCache is the internal in-memory cache of all dynamic categories. If you observe issues with stale category data, use this method to clear the cache.

Name Type Description
None
Type Description
None

The following code example shows how to call this method.

JavaScript
var api = DynamicSchemaAPI.get();api.clearDynamicCategoryCache();

DynamicSchemaAPI - clearDynamicChoiceSetCache()

Clears the entire dynamic choice set cache (DynamicChoiceSets).

DynamicChoiceSets is the internal in-memory cache of all dynamic choice sets. If you observe issues with stale choice sets data, use this method to clear the cache.

Name Type Description
None
Type Description
None

The following code example shows how to call this method.

JavaScript
var api = DynamicSchemaAPI.get(); api.clearDynamicChoiceSetCache();

DynamicSchemaAPI - clearDynamicAttributeGroupCache()

Clears the DynamicAttributeGroups and DynamicAttributes caches.

These are internal in-memory caches that contain the attribute and attribute group data. If you observe issues with stale attribute or group data, use this method to clear the cache.

Name Type Description
None
Type Description
None

The following code example shows how to call this method.

JavaScript
var api = DynamicSchemaAPI.get(); api.clearDynamicAttributeGroupCache();

DynamicSchemaAPI - clearDynamicAttributeGroupCacheItem(String sysId)

Clears the specified dynamic attribute group from the DynamicAttributeGroup cache.

If you observe issues with stale data for a specific attribute group, use this method to clear the group's cache.

Name

Type

Description

sysId

String

Sys_id of the attribute group to clear from the cache.Table: Dynamic Attribute Group [dynamic_attribute_group]

|Type|Description| |----|-----------| |None| |

The following code example shows how to call this method.

JavaScript
var api = DynamicSchemaAPI.get(); api.clearDynamicAttributeGroupCacheItem(sysId);

DynamicSchemaAPI - clearDynamicCategoryCacheItem(String sysId)

Clears a specified dynamic schema category from the DynamicCategoryCache.

DynamicCategoryCache is the internal in-memory cache of all dynamic categories. If you observe issues with stale category data for a specific category, use this method to clear that category's cache.

Name

Type

Description

sysId

String

Sys_id of the category to clear from the cache.Table: Dynamic Category [dynamic_category]

|Type|Description| |----|-----------| |None| |

The following code example shows how to call this method.

JavaScript
var api = DynamicSchemaAPI.get(); api.clearDynamicCategoryCacheItem(sysId);

DynamicSchemaAPI - clearDynamicChoiceSetItem(String sysId)

Clears a specified dynamic schema choice set from the DynamicChoiceSets cache.

DynamicChoiceSets is the internal in-memory cache for all dynamic choice sets. If you observe an issue with stale data for a specific choice set, use this method to clear that choice set's cache.

Name

Type

Description

sysId

String

Sys_id of the choice set to clear from the cache.Table: Dynamic Choice Set [dynamic_choice_set]

|Type|Description| |----|-----------| |None| |

The following code example shows how to call this method.

JavaScript
var api = DynamicSchemaAPI.get(); api.clearDynamicChoiceSetItem(sysId);

DynamicSchemaAPI - get()

Returns the DynamicSchemaAPI singleton.

You must call this method prior to calling any other DynamicSchemaAPI method.

Name Type Description
None
Type Description
None

The following code example shows how to call this method.

JavaScript
var api = DynamicSchemaAPI.get();
Search documentation
Search document titles and file paths on the brazil branch