Create a Custom Object or Array

Custom types can be used to define the structure of any variable. Create a custom type when you want a type that defines an array or an object, and you want to individually add the attributes that define the type’s data structure.

You create a custom object when you want a type to define an object that contains properties, and a custom array when you want a type to store multiple variables of the same type.

To create a custom object or array:
  1. Select your application, flow, or page artifact in the Navigator. You can also select a dynamic layout or a fragment.
  2. Click the Types tab to open the Types editor.

    The Types editor displays all the types defined for the artifact.
    Description of var-type-responsetype.png follows
    Description of the illustration var-type-responsetype.png

  3. Click + Type and select Custom.
  4. In the type's Properties pane, give the type a unique name in the ID field, then select Object or Array from the Type list.
    Description of var-type-custom-new.png follows
    Description of the illustration var-type-custom-new.png
    • To create a custom object (for example, an addressType that defines the fields of an address), select Object. An object type can also contain nested arrays.
    • To create a custom array (for example, a customerAddresses type that defines an array of addresses), select Array.

      Arrays are defined the same way as objects, but the object type is inside an array. Arrays can have nested objects or arrays as well.

  5. Define the type's structure by adding attributes:
    1. Hover next to the new type (or item type), then click Create Field to add an attribute.
    2. In the field's Properties pane, update the ID as needed and select a type for the new attribute.

    You can add as many attributes as you need to refine the type's data structure:
    Description of custom-type-object-array.png follows
    Description of the illustration custom-type-object-array.png

After you've defined your type, create a variable that uses this type. Right-click the type and select Create Variable, or go to the Variables tab to create one.

When a type is associated with a variable, you can view its usage information under Usages in the Properties pane (for example, to see which variables are based on it and which pages use those variables). Simply click a usage to readily navigate there.