GlideElementDynamicAttributeStore - Global
-
- UpdatedAug 1, 2024
- 6 minutes to read
- Xanadu
- API reference
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.
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.
This API extends the GlideElement - Global API.
For more information on dynamic attributes, see Dynamic Schema.
GlideElementDynamicAttributeStore - getDynamicAttribute(String attributePath)
Returns a GlideElementDynamicAttribute object representing the dynamic attribute located at the specified dynamic attribute path.
Name | Type | Description |
---|---|---|
attributePath | String | Attribute path to use to locate the associated dynamic schema attribute. Format: "group_name->attr_name"
For example: |
Type | Description |
---|---|
GlideElementDynamicAttribute | Object that contains the specified dynamic attributes. If the attributePath parameter contains invalid information, returns a null. |
Example
The following code example shows how to call this method.
GlideElementDynamicAttributeStore - getDynamicAttributeDisplayValue(String attributePath)
Returns the display value of the dynamic attribute located at a specified attribute path within a dynamic attribute store. If a display value is not available, it returns the internal value.
Name | Type | Description |
---|---|---|
attributePath | String | Attribute path to use to locate the associated dynamic schema attribute. Format: "group_name->attr_name"
For example: |
Type | Description |
---|---|
Object | Value for the associated dynamic attribute in human-readable format. If the attributePath parameter contains invalid information, returns a null. |
Example
The following code example shows how to call this method.
GlideElementDynamicAttributeStore - getDynamicAttributeValue(String attributePath)
Returns the internal value of the dynamic attribute pointed to by a passed-in attribute path within a dynamic attribute store.
For more information on dynamic attributes, see Dynamic Schema.
Name | Type | Description |
---|---|---|
attributePath | String | Attribute path to use to locate the associated dynamic schema attribute. Format: "group_name->attr_name"
For example: |
Type | Description |
---|---|
Object | Value of the dynamic attribute pointed to by the passed attribute path. If the attributePath parameter contains invalid information, returns a null. |
Example
The following code example shows how to call this method.
GlideElementDynamicAttributeStore - setDynamicAttributeValue(String attributePath, Object value)
Sets the attribute pointed to by a specified attribute path in a dynamic attribute store to a specified value.
For more information on dynamic attributes, see Dynamic Schema.
Name | Type | Description |
---|---|---|
attributePath | String | Attribute path to use to locate the associated dynamic schema attribute. Format: "group_name->attr_name"
For example: |
value | Object | Value to set in the specified attribute. Note: For dynamic attributes, only the following data types are supported:
|
Type | Description |
---|---|
GlideElementDynamicAttributeStore | Returns a GlideElementDynamicAttributeStore object containing the specified value. If the groupAttributePath parameter contains invalid information, the attribute is not updated. |
Example
The following code example shows how to call this method.
GlideElementDynamicAttributeStore - setDynamicAttributeValues(GlideDynamicAttributeStore values)
Sets the values specified in the passed GlideElementDynamicAttrbuteStore object in the dynamic attribute store of the current GlideRecord element. The current element's data type must be set to Dynamic Attribute Store.
For more information on dynamic attributes, see Dynamic Schema.
Name | Type | Description |
---|---|---|
values | GlideDynamicAttributeStore | Object that contains the values to set in the current element's dynamic schema. Values not specified in this object are not updated. |
Type | Description |
---|---|
GlideElementDynamicAttributeStore | Updated GlideElementDynamicAttributeStore object. |
Example
The following code example shows how to call this method.
This code example inserts the following in the u_inc_dynamic_schema column:
GlideElementDynamicAttributeStore - setDynamicAttributeDisplayValue(String attributePath)
Sets the display value of the dynamic attribute located at a specified path within the dynamic attribute store of the current GlideRecord element.
Name | Type | Description |
---|---|---|
attributePath | String | Attribute path to use to locate the associated dynamic schema attribute. Format: "group_name->attr_name"
For example: |
value | Object | Value to set in the current dynamic attribute element. The passed value must be of one of the following data types:
|
Type | Description |
---|---|
GlideElementDynamicAttributeStore | Object that contains the updated glide element. |
Example
The following code example shows how to call this method.
Output:
Example
The following code example shows how a Boolean display value is stored as "1" but is passed back as "true".
Returned value:
GlideElementDynamicAttributeStore - setDynamicAttributeDisplayValues(GlideDynamicAttributeStore values)
Sets the display values specified in the passed GlideDynamicAttrbuteStore object in the dynamic attributes of the current GlideRecord element. The current element's data type must be set to Dynamic Attribute Store in the associated table.
Name | Type | Description |
---|---|---|
values | GlideDynamicAttributeStore | Object that contains the display values to set in the current element's dynamic attribute store. Display values not specified in this object are not updated. This object must contain both the attribute path and the
display value for each attribute to store. For example: |
Type | Description |
---|---|
GlideElementDynamicAttributeStore | Object that contains the updated glide element. |
Example
The following code example shows how to call this method.
On this page
- GlideElementDynamicAttributeStore - getDynamicAttribute(String attributePath)
- GlideElementDynamicAttributeStore - getDynamicAttributeDisplayValue(String attributePath)
- GlideElementDynamicAttributeStore - getDynamicAttributeValue(String attributePath)
- GlideElementDynamicAttributeStore - setDynamicAttributeValue(String attributePath, Object value)
- GlideElementDynamicAttributeStore - setDynamicAttributeValues(GlideDynamicAttributeStore values)
- GlideElementDynamicAttributeStore - setDynamicAttributeDisplayValue(String attributePath)
- GlideElementDynamicAttributeStore - setDynamicAttributeDisplayValues(GlideDynamicAttributeStore values)