---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# DynamicSchemaAPI - Global

# DynamicSchemaAPI - Global {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 2 minutes to read

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.

For more information on dynamic attributes, see [Dynamic Schema](https://www.servicenow.com/docs/access?context=dynamic-schema&version=xanadu&pubname=xanadu-platform-administration&ft:locale=en-US).

## DynamicSchemaAPI - clearDynamicCategoryCache() {#ariaid-title2}

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.
{#DynSch-clearDynamicCategoryCache__table_etq_hmw_1bc__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 1. Parameters]

{#DynSch-clearDynamicCategoryCache__table_etq_hmw_1bc} {#DynSch-clearDynamicCategoryCache__table_ftq_hmw_1bc__entry__2}

| Type | Description |
|-|-|
| None |   |
[Table 2. Returns]

{#DynSch-clearDynamicCategoryCache__table_ftq_hmw_1bc}  
The following code example shows how to call this method.

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

## DynamicSchemaAPI - clearDynamicChoiceSetCache() {#ariaid-title3}

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.
{#DynSch-clearDynamicChoiceSetCache__table_drz_vmw_1bc__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 3. Parameters]

{#DynSch-clearDynamicChoiceSetCache__table_drz_vmw_1bc} {#DynSch-clearDynamicChoiceSetCache__table_erz_vmw_1bc__entry__2}

| Type | Description |
|-|-|
| None |   |
[Table 4. Returns]

{#DynSch-clearDynamicChoiceSetCache__table_erz_vmw_1bc}  
The following code example shows how to call this method.

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

## DynamicSchemaAPI - clearDynamicAttributeGroupCache() {#ariaid-title4}

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.
{#DynSch-clearDynAttGroupCache__table_fnn_slw_1bc__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 5. Parameters]

{#DynSch-clearDynAttGroupCache__table_fnn_slw_1bc} {#DynSch-clearDynAttGroupCache__table_gnn_slw_1bc__entry__2}

| Type | Description |
|-|-|
| None |   |
[Table 6. Returns]

{#DynSch-clearDynAttGroupCache__table_gnn_slw_1bc}  
The following code example shows how to call this method.

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

## DynamicSchemaAPI - clearDynamicAttributeGroupCacheItem(String sysId) {#ariaid-title5}

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.
{#DynSch-clearDynAttGroupCacheItem_S__table_okl_zlw_1bc__entry__3}

| Name | Type | Description |
|-|-|-|
| sysId | String | Sys_id of the attribute group to clear from the cache. Located in the Dynamic Attribute Group \[dynamic_attribute_group\] table |
[Table 7. Parameters]

{#DynSch-clearDynAttGroupCacheItem_S__table_okl_zlw_1bc} {#DynSch-clearDynAttGroupCacheItem_S__table_pkl_zlw_1bc__entry__2}

| Type | Description |
|-|-|
| None |   |
[Table 8. Returns]

{#DynSch-clearDynAttGroupCacheItem_S__table_pkl_zlw_1bc}  
The following code example shows how to call this method.

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

## DynamicSchemaAPI - clearDynamicCategoryCacheItem(String sysId) {#ariaid-title6}

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.
{#DynSch-clearDynCategoryCacheItem_S__table_mjl_nmw_1bc__entry__3}

| Name | Type | Description |
|-|-|-|
| sysId | String | Sys_id of the category to clear from the cache. Located in the Dynamic Category \[dynamic_category\] table. |
[Table 9. Parameters]

{#DynSch-clearDynCategoryCacheItem_S__table_mjl_nmw_1bc} {#DynSch-clearDynCategoryCacheItem_S__table_njl_nmw_1bc__entry__2}

| Type | Description |
|-|-|
| None |   |
[Table 10. Returns]

{#DynSch-clearDynCategoryCacheItem_S__table_njl_nmw_1bc}  
The following code example shows how to call this method.

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

## DynamicSchemaAPI - clearDynamicChoiceSetItem(String sysId) {#ariaid-title7}

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.
{#DynSch-clearDynChoiceSetItem_S__table_axs_cnw_1bc__entry__3}

| Name | Type | Description |
|-|-|-|
| sysId | String | Sys_id of the choice set to clear from the cache. Located in the Dynamic Choice Set \[dynamic_choice_set\] table. |
[Table 11. Parameters]

{#DynSch-clearDynChoiceSetItem_S__table_axs_cnw_1bc} {#DynSch-clearDynChoiceSetItem_S__table_bxs_cnw_1bc__entry__2}

| Type | Description |
|-|-|
| None |   |
[Table 12. Returns]

{#DynSch-clearDynChoiceSetItem_S__table_bxs_cnw_1bc}  
The following code example shows how to call this method.

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

## DynamicSchemaAPI - get() {#ariaid-title8}

Returns the DynamicSchemaAPI singleton.
You must call this method prior to calling any other DynamicSchemaAPI method.
{#DynSch-get__table_kcn_dlw_1bc__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 13. Parameters]

{#DynSch-get__table_kcn_dlw_1bc} {#DynSch-get__table_lcn_dlw_1bc__entry__2}

| Type | Description |
|-|-|
| None |   |
[Table 14. Returns]

{#DynSch-get__table_lcn_dlw_1bc}  
The following code example shows how to call this method.

    var api = DynamicSchemaAPI.get();


