Add dynamic attributes to a record

  • Rversion finale: Australia
  • Mis à jour 12 mars 2026
  • 1 minute de lecture
  • Store dynamic attributes and their values on a record.

    Avant de commencer

    Role required: none

    To add attributes to a dynamic attribute store field, you must have write access to the table where the store field is located.

    Pourquoi et quand exécuter cette tâche

    Once you create a dynamic attribute store field and set up the dynamic categories and dynamic attributes for its namespace, you can use one or more of the dynamic attributes to describe your records.

    Procédure

    1. Navigate to the table that holds your dynamic attribute store field.
    2. Create a record by selecting New.
    3. Facultatif : In the category reference field, select the dynamic category that contains the dynamic attributes that you want to use.
    4. Capture one or more dynamic attributes in the dynamic attribute store field by entering JSON or using the API.
      OptionDescription
      Enter JSON Enter one or more attributes and values in the dynamic store field. For example:
      { "watts: 50" , "screen_size": "75", "screen_type" : "OLED" }
      Use the API Call setValue() in the GlideRecord API and send data to the dynamic attribute store field. For example:
      var gr = new GlideRecord(‘products’);
      gr.setValue(‘televisions->watts’, '50');
      gr.setValue(‘televisions->screen_size’, '75');
      gr.setValue(‘televisions->screen_type, 'OLED');
      gr.insert();

    Résultats

    One or more dynamic attributes and their values are stored in the record. Users can query for records that have some value for an attribute. For example:

    var gr = new GlideRecord(‘products’);
    gr.addQuery(‘televisions->screen_type', ‘OLED’);
    gr.query();