---
sourceDocument: Xanadu ServiceNow AI Platform Administration
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/platform-administration

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu ServiceNow AI Platform Administration

ft:clusterId :

    - platadm

bundleId :

    - platadm

workflow :

    - Platform


---

# Dynamic Schema

# Dynamic Schema {#ariaid-title1}

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

Define a hierarchy of categories, groups, and attributes and enable users to select groups of attributes on a record.

## Key benefits {#dynamic-schema__section_x1y_px3_1bc}

* Organize and define metadata in flexible schema instead of adding new columns to a table.
* Define a structured framework for grouping dynamic attributes.
* Capture data dynamically using different attributes per record.
{#dynamic-schema__ul_gcm_qx3_1bc}

## Dynamic schema workflow {#dynamic-schema__section_cwh_5x3_1bc}

1. Plan your metadata strategy.
2. Create groups of attributes.
3. Add dynamic attributes to each group.
4. Organize your groups into categories.
5. Add dynamic attribute store fields to your tables.
6. Populate dynamic attribute store fields using the GlideRecord setValue() method.
{#dynamic-schema__ol_lt3_xx3_1bc}

## Use cases {#dynamic-schema__section_r3d_wx3_1bc}

* Capture groups of attribute-value pairs that describe products sold in a large department store by defining a dynamic schema for your products. Store the attributes and their data in a dynamic attribute store field.For example,
  assume you have a custom Products table that stores records for different types of products like televisions, sunscreens, pillows, and shirts. You can create groups of dynamic attributes for each type of product (like screen type,
  UPC, color, or size). You can organize the groups into dynamic categories (like electronics, health and beauty, home goods, and clothing). Users can add records to your Products table and capture different attributes in each product
  record.

* Describe a record by capturing one or more dynamic attribute-value pairs as string objects in a dynamic attribute store field. You can also capture transient attribute-value pairs on a record by adding a dynamic attribute store field to a table and populating the field with string data using the GlideRecord API.
{#dynamic-schema__ul_tp3_g3w_jbc}

## APIs {#dynamic-schema__section_kwh_1bm_bcc}

Dynamic schema also provides global APIs that enable you to access and manage dynamic attributes in your tables using JavaScripts. The following lists the APIs and methods that support dynamic attributes.

* [DynamicSchemaAPI - Global](https://www.servicenow.com/docs/access?context=DynamicSchemaAPI&version=xanadu&pubname=xanadu-api-reference&ft:locale=en-US)
* [GlideAggregate - Global](https://www.servicenow.com/docs/access?context=c_GlideAggregateAPI&version=xanadu&pubname=xanadu-api-reference&ft:locale=en-US)

  Only the following GlideAggregate methods support the usage of dynamic attributes:
  * [GlideAggregate - addAggregate(String agg, String name)](https://www.servicenow.com/docs/access?context=c_GlideAggregateAPI&version=xanadu&pubname=xanadu-api-reference&section=r_GlideAggregate-addAggregate_String_String&ft:locale=en-US)
  * [GlideAggregate - addHaving(String aggName, String fieldName, String operator, String value)](https://www.servicenow.com/docs/access?context=c_GlideAggregateAPI&version=xanadu&pubname=xanadu-api-reference&section=GlideAgg-addHaving_S_S_S_S&ft:locale=en-US)
  * [GlideAggregate - getDynamicAttributeValue(String fullPath)](https://www.servicenow.com/docs/access?context=c_GlideAggregateAPI&version=xanadu&pubname=xanadu-api-reference&section=GA-getDynamicAttributeValue_S&ft:locale=en-US)
  * [GlideAggregate - getDynamicAttributeValue(String dynamicAttributeField, String groupAttrPath)](https://www.servicenow.com/docs/access?context=c_GlideAggregateAPI&version=xanadu&pubname=xanadu-api-reference&section=GA-getDynamicAttributeValue_S_S&ft:locale=en-US)
  * [GlideAggregate - getDynamicAttributeDisplayValue(String fullPath)](https://www.servicenow.com/docs/access?context=c_GlideAggregateAPI&version=xanadu&pubname=xanadu-api-reference&section=GA-getDynAttributeDisplayValue_S&ft:locale=en-US)
  * [GlideAggregate - getDynamicAttributeDisplayValue(String dynamicAttributeField, String groupAttrPath)](https://www.servicenow.com/docs/access?context=c_GlideAggregateAPI&version=xanadu&pubname=xanadu-api-reference&section=GA-getDynAttributeDisplayValue_S_S&ft:locale=en-US)
  * [GlideAggregate - getValue(String name)](https://www.servicenow.com/docs/access?context=c_GlideAggregateAPI&version=xanadu&pubname=xanadu-api-reference&section=r_GlideAggregate-getValue_String&ft:locale=en-US)
  * [GlideAggregate - groupBy(String name)](https://www.servicenow.com/docs/access?context=c_GlideAggregateAPI&version=xanadu&pubname=xanadu-api-reference&section=r_GlideAggregate-groupBy_String&ft:locale=en-US)
  * [GlideAggregate - orderBy(String name)](https://www.servicenow.com/docs/access?context=c_GlideAggregateAPI&version=xanadu&pubname=xanadu-api-reference&section=r_GlideAggregate-orderBy_String&ft:locale=en-US)
  * [GlideAggregate - orderByAggregate(String agg, String fieldName)](https://www.servicenow.com/docs/access?context=c_GlideAggregateAPI&version=xanadu&pubname=xanadu-api-reference&section=r_GlideAggregate-orderByAggregate_String_String&ft:locale=en-US)
* [GlideDynamicAttributeStore - Global](https://www.servicenow.com/docs/access?context=GlideDynamicAttStoreAPI&version=xanadu&pubname=xanadu-api-reference&ft:locale=en-US)
* [GlideElementDynamicAttributeStore - Global](https://www.servicenow.com/docs/access?context=GlideElementDynamicAttStoreAPI&version=xanadu&pubname=xanadu-api-reference&ft:locale=en-US)
* [GlideRecord - Global](https://www.servicenow.com/docs/access?context=c_GlideRecordAPI&version=xanadu&pubname=xanadu-api-reference&ft:locale=en-US)

  Only the following GlideRecord methods support dynamic attributes:
  * [GlideRecord - addQuery(String name, Object operator, Object value)](https://www.servicenow.com/docs/access?context=c_GlideRecordAPI&version=xanadu&pubname=xanadu-api-reference&section=r_GlideRecord-AddQuery_String_Object_Object&ft:locale=en-US)
  * [GlideRecord - getDisplayValue(String name)](https://www.servicenow.com/docs/access?context=c_GlideRecordAPI&version=xanadu&pubname=xanadu-api-reference&section=r_GlideRecord-getDisplayValue&ft:locale=en-US)
  * [GlideRecord - getDynamicAttribute(String fullPath)](https://www.servicenow.com/docs/access?context=c_GlideRecordAPI&version=xanadu&pubname=xanadu-api-reference&section=GR-getDynamicAttribute_S&ft:locale=en-US)
  * [GlideRecord - getDynamicAttribute(String dynamicAttributeField, String groupAttrPath)](https://www.servicenow.com/docs/access?context=c_GlideRecordAPI&version=xanadu&pubname=xanadu-api-reference&section=GR-getDynamicAttribute_S_S&ft:locale=en-US)
  * [GlideRecord - getDynamicAttributeDisplayValue(String fullPath)](https://www.servicenow.com/docs/access?context=c_GlideRecordAPI&version=xanadu&pubname=xanadu-api-reference&section=GR-getDynAttributeDisplayValue_S&ft:locale=en-US)
  * [GlideRecord - getDynamicAttributeDisplayValue(String dynamicAttributeField, String groupAttrPath)](https://www.servicenow.com/docs/access?context=c_GlideRecordAPI&version=xanadu&pubname=xanadu-api-reference&section=GR-getDynAttributeDisplayValue_S_S&ft:locale=en-US)
  * [GlideRecord - getDynamicAttributeValue(String fullPath)](https://www.servicenow.com/docs/access?context=c_GlideRecordAPI&version=xanadu&pubname=xanadu-api-reference&section=GR-getDynamicAttributeValue_S&ft:locale=en-US)
  * [GlideRecord - getDynamicAttributeValue(String dynamicAttributeField, String groupAttrPath)](https://www.servicenow.com/docs/access?context=c_GlideRecordAPI&version=xanadu&pubname=xanadu-api-reference&section=GR-getDynamicAttributeValue_S_S&ft:locale=en-US)
  * [GlideRecord - getValue(String fieldName)](https://www.servicenow.com/docs/access?context=c_GlideRecordAPI&version=xanadu&pubname=xanadu-api-reference&section=r_GlideRecord-getValue_String&ft:locale=en-US)
  * [GlideRecord - orderBy(String fieldName)](https://www.servicenow.com/docs/access?context=c_GlideRecordAPI&version=xanadu&pubname=xanadu-api-reference&section=r_GlideRecord-orderBy_String&ft:locale=en-US)
  * [GlideRecord - orderByDesc(String fieldName)](https://www.servicenow.com/docs/access?context=c_GlideRecordAPI&version=xanadu&pubname=xanadu-api-reference&section=r_GlideRecord-orderByDesc_String&ft:locale=en-US)
  * [GlideRecord - setDisplayValue(String name, Object value)](https://www.servicenow.com/docs/access?context=c_GlideRecordAPI&version=xanadu&pubname=xanadu-api-reference&section=r_GlideRecord-setDisplayValue_String_Object&ft:locale=en-US)
  * [GlideRecord - setDynamicAttributeDisplayValue(String fullPath, Object value)](https://www.servicenow.com/docs/access?context=c_GlideRecordAPI&version=xanadu&pubname=xanadu-api-reference&section=GR-setDynAttributeDisplayValue_S_O&ft:locale=en-US)
  * [GlideRecord - setDynamicAttributeDisplayValue(String dynamicAttributeField, String groupAttrPath, Object value)](https://www.servicenow.com/docs/access?context=c_GlideRecordAPI&version=xanadu&pubname=xanadu-api-reference&section=GR-setDynAttributeDisplayValue_S_S_O&ft:locale=en-US)
  * [GlideRecord - setDynamicAttributeValue(String fullPath, Object value)](https://www.servicenow.com/docs/access?context=c_GlideRecordAPI&version=xanadu&pubname=xanadu-api-reference&section=GR-setDynamicAttributeValue_S_O&ft:locale=en-US)
  * [GlideRecord - setDynamicAttributeValue(String dynamicAttributeField, String groupAttrPath, Object value)](https://www.servicenow.com/docs/access?context=c_GlideRecordAPI&version=xanadu&pubname=xanadu-api-reference&section=GR-setDynamicAttributeValue_S_S_O&ft:locale=en-US)
  * [GlideRecord - setDynamicAttributeValues(String dynamicAttributeField, GlideDynamicAttributeStore values)](https://www.servicenow.com/docs/access?context=c_GlideRecordAPI&version=xanadu&pubname=xanadu-api-reference&section=GR-setDynAttributeValues_S_O&ft:locale=en-US)
  * [GlideRecord - setValue(String name, Object value)](https://www.servicenow.com/docs/access?context=c_GlideRecordAPI&version=xanadu&pubname=xanadu-api-reference&section=r_GlideRecord-setValue_String_Object&ft:locale=en-US)
{#dynamic-schema__ul_cw2_cbm_bcc}
* **[Create a dynamic attribute group](https://servicenow-prod.fluidtopics.net/OeiQpWmj86ZB_ULSia7Z1w)**   
  Organize related attributes into a dynamic attribute group.
* **[Add dynamic attributes to a dynamic group](https://servicenow-prod.fluidtopics.net/QbnRibx7NwGyqw8G6kmrkA)**   
  Define the dynamic attributes that describe a record.
* **[Create a dynamic choice set](https://servicenow-prod.fluidtopics.net/C~zdPSEkVlvPKc~yp3MASw)**   
  Define a fixed set of values for an attribute.
* **[Add choices to a dynamic choice set](https://servicenow-prod.fluidtopics.net/zsy_iTjGozjBLJ7ONibzeA)**   
  Build out a dynamic choice set by defining the choices that belong to it.
* **[Create a dynamic category](https://servicenow-prod.fluidtopics.net/gqJUIHtGczlyDtdRhBrs2g)**   
  Create a container for organizing dynamic attribute groups.
* **[Include dynamic attribute groups in a dynamic category](https://servicenow-prod.fluidtopics.net/m67uHKcVApCjTB8v8FUETA)**   
  Organize your dynamic attribute groups by relating a dynamic attribute group to a dynamic category.
* **[Storing dynamic attributes on a record](https://servicenow-prod.fluidtopics.net/sNLaICkh2IHK~_Jb2QCdlg)**   
  After you define the categories, groups, and attributes in your dynamic schema, enable users to store the attributes and their values on a record.

