Create a Custom Object or Array

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 App UI, 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.
  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.
    • To create a custom object (for example, an addressType that defines the fields of an address), select Object. An object type can 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.

    The new type is added to the list in the Types editor, with its properties displayed in the Properties pane. Here's an example of a newly created array type:
    Description of custom-type-array-example.png follows
    Description of the illustration custom-type-array-example.png

  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 type-add-field-result.png follows
    Description of the illustration type-add-field-result.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.
Description of type-create-var.png follows
Description of the illustration type-create-var.png

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 to that page.