Types
Last updated
Last updated
The 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.
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:
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.
Lists can be of any simple or complex type.
An empty List will be initialized using square brackets []
.
Choose the List type in the property dropdown (it defaults to String).
Add items to Lists by either:
Launching the List editor.
Selecting the List and value to add in the AddToList properties.
Other functions to manipulate the list are available in the Linx plugin.
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.
Instantiate a Complex type inside another one with {"PropertyName":{}}
.
Lists must be instantiated before they can be added to.
Instantiate Lists that are properties of complex types with {"PropertyName":[]}
.
Drag a from the Linx plugin onto the Function body.
Dragging an function into the Function.