Types
Simple Types
The Linx plugin contains all Simple Types. These include:
Use a Simple Type to create a variable in a Function by:
Dragging the type from the plugins panel onto the body of a Function.
Setting the Value property.

Complex Types
In the Linx Designer, Complex Types are just referred to as Types.
A Type in Linx works just like a JSON object. Types contain collections of named properties. Each property represents a Simple Type, a complex Type, or a List.
Creating a Complex Type
Click the Type button in the toolbar to add a type to your solution.
Set a name for the Type in the Properties panel.
Add properties to the Type using the Type Editor:
Add a name for each property in the Name column.
Select the property type in the Type column dropdown.

This example shows a *Type* with four properties (Address is of type 'Type_Address', Children is a List of type 'Type_Child', DOB is of type DateTime, and Name is of type String)
Here is a JSON representation of the Type_Person type:
{ "Person": { "Address": { "Street": "", "City": "", "POCode": "" }, "Children": [], "DOB": "", "Name": "" } }
Using a Complex Type
Drag the Type from the Solution Explorer onto the Function body.
By default, the type is instantiated as empty using squiggly brackets
{}
, but its properties are not initialized and default to null.

Set values for Type properties by either:
Launching the Values Editor to add values.

* Using a[ SetValue](../reference/plugins/linx/content/setvalue.md) function.

Lists
Lists can be of any simple or complex type.
Creating a List
Drag a List from the Linx plugin onto the Function body.
An empty List will be initialized using square brackets
[]
.Choose the List type in the property dropdown (it defaults to String).

Adding Items to Lists
Add items to Lists by either:
Launching the List editor.

Dragging an AddToList function into the Function.
Selecting the List and value to add in the AddToList properties.

Other functions to manipulate the list are available in the Linx plugin.

Assignment Errors
A common problem is caused by the attempt to assign values to NULL elements.
To set a value for a property of a complex type, the type cannot be null.
Attempting to set an uninstantiated type causes an 'Object reference not set to an instance of an object' error Instantiate a Complex type inside another one with
{"PropertyName":{}}
.Complex types that are properties of other complex types must be instantiated before they can be used Lists must be instantiated before they can be added to.
Attempting to add items to an uninstantiated List causes a 'Cannot add to list as it is null' error Instantiate Lists that are properties of complex types with
{"PropertyName":[]}
.Lists that are properties of complex types must be instantiated before they can be used
Tutorial Video
Last updated