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

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# GlideDynamicAttributeStore - Global

# GlideDynamicAttributeStore - Global {#ariaid-title1}

Release version: Australia  
Updated March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 10 minutes to read  
Use the GlideDynamicAttributeStore API to create objects for working with dynamic attributes independently of a table or field.

This API provides methods that enable you to get and set dynamic schema attributes in a GlideDynamicAttributeStore object. For more details on dynamic attributes, see [Dynamic schema](https://www.servicenow.com/docs/access?context=dynamic-schema&version=australia&pubname=australia-platform-administration&ft:locale=en-US).

To use this API to create dynamic attributes you must have the dynamic_schema_writer role. To read dynamic data using this API you must have the dynamic_schema_reader role.

There are methods in this API that have the same functionality as dynamic schema methods in the [GlideRecord](https://servicenow-prod.fluidtopics.net/kEnhxKeOH9ksdDjzH~63~A#c_GlideRecordAPI "The GlideRecord API is used for database operations.") API. Use this API if you want to set the same dynamic attributes on multiple records. Using this API, you can stage a GlideDynamicAttributeStore object with the intended attributes and
then copy that object to records using the setDynamicAttributeValue() or setDynamicAttributeValues() method.  
[GlideAggregate - Global](https://servicenow-prod.fluidtopics.net/aPbyi64jPLfd02y5D2rZSg#c_GlideAggregateAPI "The GlideAggregate API enables creating database aggregation queries.") methods usable with dynamic schema:

* addAggregate()
* addHaving()
* getDynamicAttributeValue()
* getDynamicAttributeDisplayValue()
* getValue()
* groupBy()
* orderBy()
* orderByAggregate()

{#GlideDynamicAttStoreAPI__ul_tc3_1nj_zgc}[GlideRecord - Global](https://servicenow-prod.fluidtopics.net/kEnhxKeOH9ksdDjzH~63~A#c_GlideRecordAPI "The GlideRecord API is used for database operations.") methods usable with dynamic schema:

* addQuery()
* getDisplayValue()
* getDynamicAttribute()
* getDynamicAttributeDisplayValue()
* getDynamicAttributeValue()
* getValue()
* orderBy()
* orderByDesc()
* setDisplayValue()
* setDynamicAttributeDisplayValue()
* setDynamicAttributeValue()
* setDynamicAttributeValues()
* setValue()
{#GlideDynamicAttStoreAPI__ul_cd4_wnj_zgc}  
See also:

* [GlideDynamicAttributeStore - Global](https://servicenow-prod.fluidtopics.net/LIzpeO8Zm4gqCjkhgpdcbw#GlideDynamicAttStoreAPI "Use the GlideDynamicAttributeStore API to create objects for working with dynamic attributes independently of a table or field.")
* [GlideDynamicNamespace - Global](https://servicenow-prod.fluidtopics.net/gcpCaMBidDHif~qHQ78buA#GlideDynamicNamespaceAPI "The GlideDynamicNamespace API provides access to dynamic namespace metadata.")
* [GlideElement - Global](https://servicenow-prod.fluidtopics.net/o_Lv25nSEwsDQ_Ej4p8L5Q#c_GlideElementAPI "The GlideElement API provides a number of convenient script methods for dealing with fields and their values. GlideElement methods are available for the fields of the current glide record.")
* [GlideElementDynamicAttributeStore - Global](https://servicenow-prod.fluidtopics.net/fjrJkrdI5LlAxwWa7NS2SQ#GlideElementDynamicAttStoreAPI "The GlideElementDynamicAttributeStore API provides convenient script methods for managing dynamic attributes in the current glide record. Use these methods in conjunction with the GlideRecord API to get and set defined dynamic attribute values.")
{#GlideDynamicAttStoreAPI__ul_dvm_lym_b2c}

## GlideDynamicAttributeStore - clear() {#ariaid-title2}

Clears all attributes and their values from the GlideDynamicAttributeStore object.
{#GDAS-clear__table_vfl_shq_1bc__entry__3}

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

{#GDAS-clear__table_vfl_shq_1bc} {#GDAS-clear__table_wfl_shq_1bc__entry__2}

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

{#GDAS-clear__table_wfl_shq_1bc}  
The following code example shows how to call this method.

    var das = new GlideDynamicAttributeStore();
    das.setDynamicAttributeValue("color","blue");
    das.setDynamicAttributeValue("make","Toyota");
    das.setDynamicAttributeValue("model","CRV");
    das.setDynamicAttributeValue("luxury",true);
    das.setDynamicAttributeValue("cost",12000.5);
    das.setDynamicAttributeValue("avg_mpg",24.5234);
    das.setDynamicAttributeValue("total_miles",5324);    
    das.setDynamicAttributeValue("date_purchased",new GlideDateTime());
    gs.info('das: ' + das.getDisplayValue());
    das.clear();
    gs.info('das: ' + das.getDisplayValue());

Output:

    *** Script: das: {
      "avg_mpg" : "24.5234",
      "color" : "blue",
      "cost" : "12000.5",
      "date_purchased" : "2024-04-19 08:29:52",
      "luxury" : "true",
      "make" : "Toyota",
      "model" : "CRV",
      "total_miles" : "5324"
    }
    *** Script: das: null

## GlideDynamicAttributeStore - getDisplayValue() {#ariaid-title3}

Returns the JSON map representation of the values stored in the current GlideDynamicAttributeStore object.
This method returns:

* Boolean values as "true" and "false" instead of 1 and 0.
* Date/time values in the user's locale instead of UTC.
{#GDAS-getDisplayValue__ul_vx3_gfq_tbc}
{#GDAS-getDisplayValue__table_cl2_cfq_1bc__entry__3}

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

{#GDAS-getDisplayValue__table_cl2_cfq_1bc} {#GDAS-getDisplayValue__table_dl2_cfq_1bc__entry__2}

| Type | Description |
|-|-|
| String | Human-readable JSON map of the values stored in the GlideDynamicAttributeStore object. The contents of this string depends on your dynamic schema definition. |
[Table 4. Returns]

{#GDAS-getDisplayValue__table_dl2_cfq_1bc}  
The following code example shows how to call this method.

    var das = new GlideDynamicAttributeStore();
    das.setDynamicAttributeValue("color","blue");
    das.setDynamicAttributeValue("make","Honda");
    das.setDynamicAttributeValue("model","CRV");
    das.setDynamicAttributeValue("luxury",false);
    das.setDynamicAttributeValue("cost",12000.5);
    das.setDynamicAttributeValue("avg_mpg", 24.5234);
    das.setDynamicAttributeValue("total_miles", 5324);
    das.setDynamicAttributeValue("date_purchased",new GlideDateTime());
    gs.info('Value returned by getValue(): ' + das.getValue());
    gs.info('Value returned by getDisplayValue(): ' + das.getDisplayValue());

Output:

    *** Script: Value returned by getValue(): {"total_miles":5324,"color":"blue","model":"CRV","cost":12000.5,"luxury":1,"avg_mpg":24.5234,"make":"Toyota","date_purchased":"2024-04-19 15:33:23"}
    *** Script: Value returned by getDisplayValue(): {
      "avg_mpg" : "24.5234",
      "color" : "blue",
      "cost" : "12000.5",
      "date_purchased" : "2024-04-19 08:33:23",
      "luxury" : "false",
      "make" : "Honda",
      "model" : "CRV",
      "total_miles" : "5324"
    }

## GlideDynamicAttributeStore - getDynamicAttribute(String attributePath) {#ariaid-title4}

Returns dynamic attribute object located at a specified dynamic attribute path.
{#GDAS-getDynamicAttribute__table_gzs_jld_bbc__entry__3}

| Name | Type | Description |
|-|-|-|
| attributePath | String | Attribute path to use to locate the associated dynamic schema attribute. Format: `"attr_name"` `attr_name`: Name of the dynamic attribute. Table: In the attribute field of the Dynamic Attribute \[dynamic_attribute\] table. |
[Table 5. Parameters]

{#GDAS-getDynamicAttribute__table_gzs_jld_bbc} {#GDAS-getDynamicAttribute__table_hzs_jld_bbc__entry__2}

| Type | Description |
|-|-|
| IDynamicAttribute | Object containing dynamic attributes. |
[Table 6. Returns]

{#GDAS-getDynamicAttribute__table_hzs_jld_bbc}  
The following code example shows how to call this method.

    //Gets all the values of the make attribute from the u_inc_dynamic_schema dynamic attribute store column on the incident table
    var gr_Inc = new GlideRecord('incident');
    gr_Inc.query();
    while(gr_Inc.next()) {
        var attr = gr.getDynamicAttribute('inc_dynamic_schema->make');
        gs.info(attr.getValue());
    }

    //You can also use if(gr_Inc.next()) if you don't want all the values
    var gr_Inc = new GlideRecord('incident');
    gr_Inc.query();
    if(gr_Inc.next()) {
        var attr = gr_Inc.getDynamicAttribute('inc_dynamic_schema->make');
        gs.info(attr.getValue());
    }

## GlideDynamicAttributeStore - getDynamicAttributes() {#ariaid-title5}

Returns the set of dynamic attribute definitions present in the store.
{#GDAS-getDynamicAttributes__table_psl_m3q_1bc__entry__3}

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

{#GDAS-getDynamicAttributes__table_psl_m3q_1bc} {#GDAS-getDynamicAttributes__table_qsl_m3q_1bc__entry__2}

| Type | Description |
|-|-|
| Array | Array containing all transient and non-transient dynamic attributes present in the store. * Dynamic attributes are defined in the Dynamic Attribute \[dynamic_attribute\] table with a data type and a sys_id. See [GlideDynamicAttribute](https://servicenow-prod.fluidtopics.net/qkURqhb1AentmdQLTt_bMw#GlideDynamicAttributeAPI "The GlideDynamicAttribute API provides access to dynamic attribute metadata.").{#GDAS-getDynamicAttributes__ph-dynamic-attribute-desc} * Transient dynamic attributes are dynamic attributes that have been added to a DynamicAttributeStore field without a definition in the Dynamic Attribute \[dynamic_attribute\] table. Transient dynamic attributes are handled as strings and have no sys_id.{#GDAS-getDynamicAttributes__ph-trns-dynamic-attribute-desc} {#GDAS-getDynamicAttributes__ul_pjk_hhm_d2c} |
[Table 8. Returns]

{#GDAS-getDynamicAttributes__table_qsl_m3q_1bc}  
The following example shows how to retrieve transient and non-transient dynamic attributes.

    var used_car = new GlideDynamicAttributeStore('u_product/u_car_inventory');
    used_car.setDynamicAttributeValue('mfg_year', 2014);       // transient (adding here)
    used_car.setDynamicAttributeValue('u_total_miles', 53246); // defined in dynamic_attribute table

    var attributes = used_car.getDynamicAttributes();
    gs.info(attributes);

    for (var i = 0; i < attributes.length; i++) {
        var attr = attributes[i];
        gs.info("");
        gs.info("[" + i + "].getPath()           = " + attr.getPath());
        gs.info("[" + i + "].getName()           = " + attr.getName());
        gs.info("[" + i + "].getNamespaceName()  = " + attr.getNamespaceName());
        gs.info("[" + i + "].getNamespacedName() = " + attr.getNamespacedName());
        gs.info("[" + i + "].isTransient()       = " + attr.isTransient());
        gs.info("[" + i + "].getType()           = " + attr.getType());
    }

Output:

    *** Script: mfg_year,u_total_miles
    *** Script: 
    *** Script: [0].getPath()           = mfg_year
    *** Script: [0].getName()           = mfg_year
    *** Script: [0].getNamespaceName()  = u_product/u_car_inventory
    *** Script: [0].getNamespacedName() = u_product/u_car_inventory/mfg_year
    *** Script: [0].isTransient()       = true
    *** Script: [0].getType()           = string
    *** Script: 
    *** Script: [1].getPath()           = u_total_miles
    *** Script: [1].getName()           = u_total_miles
    *** Script: [1].getNamespaceName()  = u_product/u_car_inventory
    *** Script: [1].getNamespacedName() = u_product/u_car_inventory/u_total_miles
    *** Script: [1].isTransient()       = false
    *** Script: [1].getType()           = integer

## GlideDynamicAttributeStore - getDynamicAttributeValue(String attrPath) {#ariaid-title6}

Returns the value of the specified attribute within the dynamic attribute store element.
{#GDAS-getDynamicAttributeValue_S__table_psl_m3q_1bc__entry__3}

| Name | Type | Description |
|-|-|-|
| attrPath | String | Attribute path to use to locate the associated dynamic schema attribute. Format: `"attr_name"` `attr_name`: Name of the dynamic attribute. Table: In the attribute field of the Dynamic Attribute \[dynamic_attribute\] table. |
[Table 9. Parameters]

{#GDAS-getDynamicAttributeValue_S__table_psl_m3q_1bc} {#GDAS-getDynamicAttributeValue_S__table_qsl_m3q_1bc__entry__2}

| Type | Description |
|-|-|
| Object | Value of the dynamic schema attribute referenced by the passed group/attribute path. If the attributePath parameter contains invalid information, returns a null. |
[Table 10. Returns]

{#GDAS-getDynamicAttributeValue_S__table_qsl_m3q_1bc}  
The following code example shows how to call this method.

    var das = new GlideDynamicAttributeStore();
    das.setDynamicAttributeValue("color","blue");
    das.setDynamicAttributeValue("make","Toyota");
    das.setDynamicAttributeValue("model","CRV");
    das.setDynamicAttributeValue("luxury",true);
    das.setDynamicAttributeValue("cost",12000.5);
    das.setDynamicAttributeValue("avg_mpg", 24.5234);
    das.setDynamicAttributeValue("total_miles", 5324);
    das.setDynamicAttributeValue("date_purchased", new GlideDateTime());
    gs.info('Value returned by getDynamicAttributeValue(): ' + das.getDynamicAttributeValue("color"));
    gs.info('Value returned by getDynamicAttributeValue(): ' + das.getDynamicAttributeValue("luxury"));

Output:

    *** Script: Value returned by getDynamicAttributeValue(): blue
    *** Script: Value returned by getDynamicAttributeValue(): 1

## GlideDynamicAttributeStore - getDynamicNamespace() {#ariaid-title7}

Returns the dynamic namespace.
{#GDAS-getDynamicNamespace__table_psl_m3q_1bc__entry__3}

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

{#GDAS-getDynamicNamespace__table_psl_m3q_1bc} {#GDAS-getDynamicNamespace__table_qsl_m3q_1bc__entry__2}

| Type | Description |
|-|-|
| Object | Namespace object. |
[Table 12. Returns]

{#GDAS-getDynamicNamespace__table_qsl_m3q_1bc}  
The following example shows how to create a store using a dynamic namespace, and retrieve the name of the namespace.

    gs.info("car_inventory = new GlideDynamicAttributeStore('u_product/u_car_inventory')");
    var car_inventory = new GlideDynamicAttributeStore("u_product/u_car_inventory");
    gs.info("car_inventory.getDynamicNamespace() : " + car_inventory.getDynamicNamespace());
    var ns1 = car_inventory.getDynamicNamespace();

Output:

    *** Script: new_cars = new GlideDynamicAttributeStore('u_product/u_car_inventory')
    *** Script: new_cars.getDynamicNamespace() : u_product/u_car_inventory

## GlideDynamicAttributeStore - getValue() {#ariaid-title8}

Returns the compact string representation of the contents of the current GlideDynamicAttributeStore object.
This method returns:

* Boolean values as 1 and 0 instead of "true" and "false".
* Date/time values in UTC instead of the user's locale.
{#GDAS-getValue__ul_un2_cgq_tbc}
{#GDAS-getValue__table_zyb_dcq_1bc__entry__3}

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

{#GDAS-getValue__table_zyb_dcq_1bc} {#GDAS-getValue__table_azb_dcq_1bc__entry__2}

| Type | Description |
|-|-|
| String | Compact string representation of the values stored in the GlideDynamicAttributeStore object. The contents of this string depends on your dynamic schema definition. |
[Table 14. Returns]

{#GDAS-getValue__table_azb_dcq_1bc}  
The following code example shows how to call this method.

    var das = new GlideDynamicAttributeStore();
    das.setDynamicAttributeValue("color","blue");
    das.setDynamicAttributeValue("make","Honda");
    das.setDynamicAttributeValue("model","CRV");
    das.setDynamicAttributeValue("luxury",false);
    das.setDynamicAttributeValue("cost",12000.5);
    das.setDynamicAttributeValue("avg_mpg", 24.5234);
    das.setDynamicAttributeValue("total_miles", 5324);
    das.setDynamicAttributeValue("date_purchased",new GlideDateTime());
    gs.info('Value returned by getValue(): ' + das.getValue());
    gs.info('Value returned by getDisplayValue(): ' + das.getDisplayValue());

Output:

    *** Script: Value returned by getValue(): {"total_miles":5324,"color":"blue","model":"CRV","cost":12000.5,"luxury":1,"avg_mpg":24.5234,"make":"Toyota","date_purchased":"2024-04-19 15:33:23"}
    *** Script: Value returned by getDisplayValue(): {
      "avg_mpg" : "24.5234",
      "color" : "blue",
      "cost" : "12000.5",
      "date_purchased" : "2024-04-19 08:33:23",
      "luxury" : "false",
      "make" : "Honda",
      "model" : "CRV",
      "total_miles" : "5324"
    }

## GlideDynamicAttributeStore - setDisplayValue(Object value) {#ariaid-title9}

Clears the current GlideDynamicAttributeStore object and then stores the passed JSON map in the GlideDynamicAttributeStore object.
This method is functionally the same as [GlideDynamicAttributeStore - setValue(Object value)](https://servicenow-prod.fluidtopics.net/LIzpeO8Zm4gqCjkhgpdcbw#GDAS-setValue_O "Clears the current GlideDynamicAttributeStore object and then stores the passed JSON map in that GlideDynamicAttributeStore object."), except that it assumes that all date values are provided in the user's locale.
{#GDAS-setDisplayValue_O__table_zpm_m2j_1bc__entry__3}

| Name | Type | Description |
|-|-|-|
| value | Object | Value to set in the current dynamic attribute store object. The passed value must be of one of the following data types: * Boolean (True/False) * Decimal * Floating Point Number * GlideDate * GlideDateTime * Integer * String {#GDAS-setDisplayValue_O__DynS-valid_data_types-ul} |
[Table 15. Parameters]

{#GDAS-setDisplayValue_O__table_zpm_m2j_1bc} {#GDAS-setDisplayValue_O__table_aqm_m2j_1bc__entry__2}

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

{#GDAS-setDisplayValue_O__table_aqm_m2j_1bc}  
The following example shows how to call this method.

    var das = new GlideDynamicAttributeStore();
    das.setDynamicAttributeValue("color","blue");
    das.setDynamicAttributeValue("make","Honda");
    das.setDynamicAttributeValue("model","CRV");
    das.setDynamicAttributeValue("luxury",false);
    das.setDynamicAttributeValue("cost",12000.5);
    das.setDynamicAttributeValue("avg_mpg", 24.5234);
    das.setDynamicAttributeValue("total_miles", 5324);    
    das.setDynamicAttributeValue("date_purchased",new GlideDateTime());
    gs.info('das: ' + das.getDisplayValue());
    das.setDisplayValue('{"luxury":false}');
    gs.info('das: ' + das.getDisplayValue());

Output:

    *** Script: das: {
      "avg_mpg" : "24.5",
      "color" : "blue",
      "cost" : "12000.0",
      "date_purchased" : "2024-04-19 14:16:49",
      "luxury" : "false",
      "make" : "Honda",
      "model" : "CRV",
      "total_miles" : "5324.0"
    }
    *** Script: das: {
      "luxury" : "false"
    }

## GlideDynamicAttributeStore - setDynamicAttributeDisplayValue(String attrPath, Object value) {#ariaid-title10}

Sets the value of the dynamic attribute located at a specified path within a dynamic attribute store element.
This method works the same as the [GlideDynamicAttributeStore - setDynamicAttributeValue(String attrPath, Object value)](https://servicenow-prod.fluidtopics.net/LIzpeO8Zm4gqCjkhgpdcbw#GDAS-setDynamicAttributeValue_S_O "Sets the dynamic attribute referenced by a specified attribute path to a specified value.") method except in its handling of Boolean and date/time values. This method assumes that all date/time values are provided in the user's locale.
{#GDAS-setDynamicAttDisplayValue_S_O__table_zqq_cxp_1bc__entry__3}

| Name | Type | Description |
|-|-|-|
| attrPath | String | Attribute path to use to locate the associated dynamic schema attribute. Format: `"attr_name"` `attr_name`: Name of the dynamic attribute. Table: In the attribute field of the Dynamic Attribute \[dynamic_attribute\] table. |
| value | Object | Value to set in the specified attribute. Note: For dynamic attributes, only the following data types are supported: * Boolean (True/False) * Decimal * Floating Point Number * GlideDate * GlideDateTime * Integer * String {#GDAS-setDynamicAttDisplayValue_S_O__ul_dwc_vyy_1hc} |
[Table 17. Parameters]

{#GDAS-setDynamicAttDisplayValue_S_O__table_zqq_cxp_1bc} {#GDAS-setDynamicAttDisplayValue_S_O__table_arq_cxp_1bc__entry__2}

| Type | Description |
|-|-|
| Object | Updated GlideDynamicAttributeStore object. If the attrPath parameter isn't valid, the method throws an IllegalArgumentException. |
[Table 18. Returns]

{#GDAS-setDynamicAttDisplayValue_S_O__table_arq_cxp_1bc}  
The following code example shows how to call this method.

    var das = new GlideDynamicAttributeStore();
    das.setDynamicAttributeDisplayValue("color","blue");
    das.setDynamicAttributeDisplayValue("make","Honda");
    das.setDynamicAttributeDisplayValue("model","CRV");
    das.setDynamicAttributeDisplayValue("luxury","false");
    das.setDynamicAttributeDisplayValue("cost",12000.5);
    das.setDynamicAttributeDisplayValue("avg_mpg", 24.5234);
    das.setDynamicAttributeDisplayValue("total_miles", 5324);    
    das.setDynamicAttributeDisplayValue("date_purchased",new GlideDateTime());
    gs.info('das: ' + das.getDisplayValue());
    das.setDisplayValue('{"luxury":"false"}');
    gs.info('das: ' + das.getDisplayValue());

Output:

    *** Script: das: {
      "avg_mpg" : "24.5234",
      "color" : "blue",
      "cost" : "12000.5",
      "date_purchased" : "2024-04-19 10:40:45",
      "luxury" : "false",
      "make" : "Honda",
      "model" : "CRV",
      "total_miles" : "5324"
    }
    *** Script: das: {
      "luxury" : "false"
    }

## GlideDynamicAttributeStore - setDynamicAttributeValue(String attrPath, Object value) {#ariaid-title11}

Sets the dynamic attribute referenced by a specified attribute path to a specified value.
{#GDAS-setDynamicAttributeValue_S_O__table_zgx_1np_1bc__entry__3}

| Name | Type | Description |
|-|-|-|
| attrPath | String | Attribute path to use to locate the associated dynamic schema attribute. Format: `"attr_name"` `attr_name`: Name of the dynamic attribute. Table: In the attribute field of the Dynamic Attribute \[dynamic_attribute\] table. |
| value | Object | Value to set in the specified attribute. Note: For dynamic attributes, only the following data types are supported: * Boolean (True/False) * Decimal * Floating Point Number * GlideDate * GlideDateTime * Integer * String {#GDAS-setDynamicAttributeValue_S_O__ul_dwc_vyy_1hc} |
[Table 19. Parameters]

{#GDAS-setDynamicAttributeValue_S_O__table_zgx_1np_1bc} {#GDAS-setDynamicAttributeValue_S_O__table_ahx_1np_1bc__entry__2}

| Type | Description |
|-|-|
| Object | Updated GlideDynamicAttributeStore object. If the attrPath parameter isn't valid, the method throws an IllegalArgumentException. |
[Table 20. Returns]

{#GDAS-setDynamicAttributeValue_S_O__table_ahx_1np_1bc}  
The following code example shows how to call this method.

    var das = new GlideDynamicAttributeStore();
    das.setDynamicAttributeValue("color","blue");
    das.setDynamicAttributeValue("make","Honda");
    das.setDynamicAttributeValue("model","CRV");
    das.setDynamicAttributeValue("luxury",false);
    das.setDynamicAttributeValue("cost",12000.5);
    das.setDynamicAttributeValue("avg_mpg", 24.5234);
    das.setDynamicAttributeValue("total_miles", 5324);
    das.setDynamicAttributeValue("date_purchased",new GlideDateTime());
    gs.info('Value returned by getValue(): ' + das.getValue());
    gs.info('Value returned by getDisplayValue(): ' + das.getDisplayValue());

Output:

    *** Script: Value returned by getValue(): {"total_miles":5324,"color":"blue","model":"CRV","cost":12000.5,"luxury":1,"avg_mpg":24.5234,"make":"Toyota","date_purchased":"2024-04-19 15:33:23"}
    *** Script: Value returned by getDisplayValue(): {
      "avg_mpg" : "24.5234",
      "color" : "blue",
      "cost" : "12000.5",
      "date_purchased" : "2024-04-19 08:33:23",
      "luxury" : "false",
      "make" : "Honda",
      "model" : "CRV",
      "total_miles" : "5324"
    }

## GlideDynamicAttributeStore - setDynamicAttributeValues(Object value) {#ariaid-title12}

Sets the internal JSON storage for the field to the String representation of the passed value. If the passed value is another instance of a GlideDynamicAttributeStore object, it copies the values from that object to the current
object.
{#GDAS-setDynamicAttributeValues_O__table_azz_kbp_1bc__entry__3}

| Name | Type | Description |
|-|-|-|
| value | Object | JSON object to store as the value in the associated GlideRecord. The method ignores any invalid JSON values. |
[Table 21. Parameters]

{#GDAS-setDynamicAttributeValues_O__table_azz_kbp_1bc} {#GDAS-setDynamicAttributeValues_O__table_bzz_kbp_1bc__entry__2}

| Type | Description |
|-|-|
| Object | Updated GlideDynamicAttributeStore object. |
[Table 22. Returns]

{#GDAS-setDynamicAttributeValues_O__table_bzz_kbp_1bc}  
The following example shows how to store attribute/value pairs in a GlideDynamicAttributeStore object and then copy those same values from one object to another.

    var das = new GlideDynamicAttributeStore();
    var otherValues = new GlideDynamicAttributeStore();
    otherValues.setDynamicAttributeValue("position_x", 5);
    otherValues.setDynamicAttributeValue("position_y", 6);

    das.setDynamicAttributeValues(otherValues);
    gs.info(das);

Output:

    {"position_x":"5.0","position_y":"6.0"}

## GlideDynamicAttributeStore - setDynamicNamespace(String namespaceName) {#ariaid-title13}

Sets a dynamic namespace name.
{#GDAS-setDynamicNamespace_S__table_azz_kbp_1bc__entry__3}

| Name | Type | Description |
|-|-|-|
| namespaceName | String | Dynamic namespace name. |
[Table 23. Parameters]

{#GDAS-setDynamicNamespace_S__table_azz_kbp_1bc} {#GDAS-setDynamicNamespace_S__table_bzz_kbp_1bc__entry__2}

| Type | Description |
|-|-|
| Object | Updated GlideDynamicAttributeStore object. |
[Table 24. Returns]

{#GDAS-setDynamicNamespace_S__table_bzz_kbp_1bc}  
The following example shows how to sets the name of a default namespace to `namespace1`.

    gs.info("store1 = new GlideDynamicAttributeStore()");
    var store1 = new GlideDynamicAttributeStore();
    gs.info("store1.getDynamicNamespace() : " + store1.getDynamicNamespace());
    gs.info("store1.setDynamicNamespace('namespace1')");
    store1.setDynamicNamespace('namespace1');
    gs.info("store1.getDynamicNamespace() : " + store1.getDynamicNamespace());

Output:

    *** Script: store1 = new GlideDynamicAttributeStore()
    *** Script: store1.getDynamicNamespace() : default
    *** Script: store1.setDynamicNamespace('namespace1')
    *** Script: store1.getDynamicNamespace() : namespace1

## GlideDynamicAttributeStore - setValue(Object value) {#ariaid-title14}

Clears the current GlideDynamicAttributeStore object and then stores the passed JSON map in that GlideDynamicAttributeStore object.
This method is functionally the same as [GlideDynamicAttributeStore - setDisplayValue(Object value)](https://servicenow-prod.fluidtopics.net/LIzpeO8Zm4gqCjkhgpdcbw#GDAS-setDisplayValue_O "Clears the current GlideDynamicAttributeStore object and then stores the passed JSON map in the GlideDynamicAttributeStore object.") except that it assumes that all date values are in UTC.
{#GDAS-setValue_O__table_uh2_2hj_1bc__entry__3}

| Name | Type | Description |
|-|-|-|
| value | Object | JSON map object to store in the GlideDynamicAttributeStore object. For example: `'{"cost":"12500"}'` This method ignores any invalid JSON values. |
[Table 25. Parameters]

{#GDAS-setValue_O__table_uh2_2hj_1bc} {#GDAS-setValue_O__table_vh2_2hj_1bc__entry__2}

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

{#GDAS-setValue_O__table_vh2_2hj_1bc}  
The following example shows how to call this method.

    var das = new GlideDynamicAttributeStore();
    das.setDynamicAttributeValue("color","blue");
    das.setDynamicAttributeValue("make","Toyota");
    das.setDynamicAttributeValue("model","Rav4");
    das.setDynamicAttributeValue("luxury",false);
    das.setDynamicAttributeValue("cost",12000.5);
    das.setDynamicAttributeValue("avg_mpg", 24.5234);
    das.setDynamicAttributeValue("total_miles", 5324);    
    das.setDynamicAttributeValue("date_purchased", new GlideDateTime());
    gs.info('das: ' + das.getValue());
    das.setValue('{"luxury":false}');
    gs.info('das: ' + das.getValue());

Output:

    *** Script: das: {"total_miles":5324,"color":"blue","model":"Rav4","cost":12000.5,"luxury":false,"avg_mpg":24.5234,"make":"Toyota","date_purchased":"2024-04-19 17:28:47"}
    *** Script: das: {"luxury":false}

## GlideDynamicAttributeStore - toString() {#ariaid-title15}

Returns the content of the GlideDynamicAttributeStore object as a string.
{#GDAS-toString__table_fgm_kgq_1bc__entry__3}

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

{#GDAS-toString__table_fgm_kgq_1bc} {#GDAS-toString__table_ggm_kgq_1bc__entry__2}

| Type | Description |
|-|-|
| String | GlideDynamicAttribute object as a string. For example: `'{"attr2":"true","attr1":"42.0"}'` |
[Table 28. Returns]

{#GDAS-toString__table_ggm_kgq_1bc}  
The following code example shows how to call this method.

    var das = new GlideDynamicAttributeStore();
    das.setDynamicAttributeValue("color","blue");
    das.setDynamicAttributeValue("make","Toyota");
    das.setDynamicAttributeValue("model","CRV");
    das.setDynamicAttributeValue("luxury",true);
    das.setDynamicAttributeValue("cost",12000);
    das.setDynamicAttributeValue("avg_mpg",24.5);
    das.setDynamicAttributeValue("total_miles",5324);    
    das.setDynamicAttributeValue("date_purchased",new GlideDateTime());
    gs.info('das: ' + das.toString());

Output:

    *** Script: das: {"cost":"12000.0","color":"blue","avg_mpg":"24.5","date_purchased":"2024-04-19 14:05:00","luxury":"true","model":"CRV","make":"Toyota","total_miles":"5324.123"}


