Manage User-Defined Types
(Available from version 7.0 onwards.)
In addition to Built-in types, Automation Studio allows you to create User-Defined Types. When you create a user-defined type, you can define any number of properties for the type. They are typically used to represent complex real-world entities, such as customers, transactions, and products. Any number of variables of the same user-defined type can then be created as complex variables.
For example, the Assets Panel below lists two variables. They are both of the same type (Customer), and share the same list of properties. The values of their properties will be different.
The properties of a user-defined type can be of any of the following types:
-
Simple types (Text, Number, Decimal, Boolean, DateTime)
-
Complex types
-
User-defined types
Show example
For example, when creating a Customer user-defined type, instead of adding individual properties for Street, City, and Country, first create another user-defined type called Address with those properties.
Now add a single Address property to the Customer user-defined type.
If you create a variable of type Customer, its Address property is displayed in the Assets Panel and with its own properties indented below it.
Note that circular (recursive) type references are not allowed. For example:
-
Type A cannot have a property of type A.
-
If type A has a property of type B, then type B cannot have a property of type A.
-
If type A has a property of type B, and type B has a property of type C, then type C cannot have a property of type A or type B.
-
-
Lists of simple, complex, and user-defined types
Create a User-Defined Type
-
Above the Assets Panel, click and then select USER-DEFINED TYPE.
The Variables and Types panel is displayed.
-
Enter a User Defined Type Name for the new user-defined type. Each type must have a unique name.
-
[Optional] Enter a Description for the user-defined type.
-
To add a property to the user-defined type, click Create New.
-
Specify the NAMEand TYPE of the property. Each property within the user-defined type must have a unique name.
-
The new type is listed on the Variables and Types panel, under USER-DEFINED TYPES.
Edit a User-Defined Type
-
At the bottom-left of the screen, click .
The Variables and Types panel is displayed.
-
Expand USER-DEFINED TYPES on the left, and select the type to edit.
Best Practices
For best practices to apply when working with user-defined types, see Best Practices for Used-Defined Types.