---
sourceDocument: Xanadu Now Platform の管理
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/ja-JP/xanadu/platform-administration

 Release :

    - xanadu

ft:locale :

    - ja-JP

ft:publication_title :

    - Xanadu Now Platform の管理

ft:clusterId :

    - platadm

bundleId :

    - platadm

workflow :

    - Platform


---

# 動的なスキーマ

# 動的なスキーマ {#ariaid-title1}

* リリースバージョン: Xanadu
* 
* 更新日 2024年08月01日
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 所要時間：5分

カテゴリ、グループ、および属性の階層を定義し、ユーザーがレコード上で属性のグループを選択できるようにします。

## 主なメリット {#dynamic-schema__section_x1y_px3_1bc}

* テーブルに新しい列を追加する代わりに、柔軟なスキーマでメタデータを整理および定義します。
* 動的属性をグループ化するための構造化フレームワークを定義します。
* レコードごとに異なる属性を使用してデータを動的にキャプチャします。
{#dynamic-schema__ul_gcm_qx3_1bc}

## 動的スキーマワークフロー {#dynamic-schema__section_cwh_5x3_1bc}

1. メタデータ戦略を計画します。
2. 属性のグループを作成します。
3. 各グループに動的属性を追加します。
4. グループをカテゴリ別に整理します。
5. 動的属性ストアフィールドをテーブルに追加します。
6. GlideRecord setValue() メソッドを使用して動的属性ストアフィールドに入力します。
{#dynamic-schema__ol_lt3_xx3_1bc}

## ユースケース {#dynamic-schema__section_r3d_wx3_1bc}

* 製品の動的スキーマを定義して、大規模な百貨店で販売されている製品を説明する属性とその値のペアをグループとしてキャプチャします。属性とそのデータを動的属性ストアフィールドに格納します。たとえば、テレビ、日焼け止め、枕、シャツなど、さまざまなタイプの商品のレコードを格納するカスタム商品テーブルがあるとします。商品の種類 (画面タイプ、UPC、色、サイズなど) ごとに動的属性のグループを作成できます。グループを動的なカテゴリ (電化製品、健康と美容、家庭用品、衣料品など) に整理できます。ユーザーは製品テーブルにレコードを追加し、各製品レコードで異なる属性をキャプチャできます。

* 動的属性ストアフィールドで 1 つ以上の動的な属性とその値のペアを文字列オブジェクトとしてキャプチャして、レコードを記述します。動的属性ストアフィールドをテーブルに追加し、GlideRecord API を使用してフィールドに文字列データを入力することで、レコードの一時的な属性と値のペアをキャプチャすることもできます。
{#dynamic-schema__ul_tp3_g3w_jbc}

## API {#dynamic-schema__section_kwh_1bm_bcc}

動的スキーマは、JavaScript を使用してテーブル内の動的属性にアクセスして管理できるようにするグローバル API も提供します。次に、動的属性をサポートする API とメソッドを示します。

* [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)

  次の GlideAggregate メソッドのみが動的属性の使用をサポートしています。
  * [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)

  次の GlideRecord メソッドのみが動的属性をサポートしています。
  * [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)getDynamicAttributeValue(String fullPath)
  * [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}
* **[動的属性グループの作成](https://servicenow-prod.fluidtopics.net/LbArHK8UhFVaFsrJmow2yw)**   
  関連する属性を動的属性グループに編成します。
* **[動的グループへの動的属性の追加](https://servicenow-prod.fluidtopics.net/mNfEZfuCUX9OmjP4uuSYlQ)**   
  レコードを説明する動的属性を定義します。
* **[動的選択肢セットの作成](https://servicenow-prod.fluidtopics.net/rHShGrMycvQext97TYMqdA)**   
  属性の固定値セットを定義します。
* **[動的選択肢セットに選択肢を追加する](https://servicenow-prod.fluidtopics.net/W~wqpKmkIKS1T0U7qKW2EA)**   
  動的選択肢セットに属する選択肢を定義して、動的選択肢セットを構築します。
* **[動的カテゴリの作成](https://servicenow-prod.fluidtopics.net/w3LboztVmGJOHeU2Rn8O7A)**   
  動的属性グループを編成するためのコンテナを作成します。
* **[動的カテゴリへの動的属性グループの組み込み](https://servicenow-prod.fluidtopics.net/cECbJDhYhnO9C1RjLfTmzg)**   
  動的属性グループを動的カテゴリに関連付けることによって、動的属性グループを編成します。
* **[レコードへの動的属性の保存](https://servicenow-prod.fluidtopics.net/yf8Klw~f6OIPViE8EDt7ig)**   
  動的スキーマでカテゴリ、グループ、および属性を定義した後に、ユーザーが属性とその値をレコードに保存できるようにします。

