Item Form Expression Builder
Build an expression visually
When you create or edit an expression, the Item Form Expression Builder will appear.
1 Name
Select to edit the name of the expression. We recommend making it a clear description of what the expression does, so it can be easily picked from a list when someone configures a control property.
2 Node types
Nodes are the building blocks of your expression. Each type represents a function or a value. Values can be static, or dynamically linked to a control property on the item form, or dynamically linked to a global Alloy variable, e.g. the current user's name.
Select a node type in the toolbar to add a node to the canvas.
-
Conditionals - logical functions that test inputs from other nodes and produce corresponding output.
-
Finals - the expression's output, which will be applied to any control property that targets it.
-
Globals - references to the dynamic value of a control property or a global Alloy variable.
-
Literals - static values that you input yourself.
-
Transforms - functions that modify an input value, producing a new value.
-
Dates - functions for creating or manipulating date values.
-
Date Times - functions for creating or manipulating date and time values.
For the full list, see Item form expression node types.
3 Tools
Select a tool in the toolbar:
-
Delete - delete the currently selected node or link.
-
Organise - automatically arrange nodes into formation based on how they're linked.
4 Added nodes
Nodes appear on the canvas as blue boxes, displaying their type and a helpful description of what they do. You can drag them around and use their bottom-right corner to resize them.
To set the value of a node, select its icon and then its Value field.
If it's a Global node, a list of global Alloy variables and compatible control properties will appear. Choose one to link to.
Global Alloy variables
Variable | Description | Global node type |
---|---|---|
User Alloy ID | The ID of the current user | Alloy ID Array |
Item ID | The ID of the item being create/edited | Alloy ID Array |
Parent item ID | The IDs of any parent items that link to the item being created/edited | Alloy ID Array |
Create mode | Is the item form being used to create an item? | Boolean |
Edit mode | Is the item form being used to edit an item? | Boolean |
Date Now | The current date | Date |
Date Time Now | The current date and time | Date Time |
Username | The username of the current user | String |
First name | The first name of the current user | String |
Last name | The last name of the current user | String |
The email address of the current user | String | |
Customer name | The name of the current customer project | String |
Item form name | The name of the current item form | String |
Item form context | The context of the current item form | String |
Design name | The design name of the item being created/edited | String |
Design context | The design context of the item being created/edited | String |
Item icon | The icon code of the item being created/edited | String |
Item signature | The signature of the item being edited (changes with every edit) | String |
Item collection | The Guc of the collection of the item being created/edited | IsTriggering |
Item form code | The Guc of the current item form | IsTriggering |
Design code | The Guc of the design of the item being created/edited | IsTriggering |
If it's a Literal node, you can then provide a value. Depending on the node type, this may involve typing directly into the field, choosing a value from a picker, using the AQS Builder, or enabling/disabling the field to indicate true
or false
.
5 Links
Define your expression by linking the inputs and outputs of different nodes on the canvas.
Each node has one or more input circles on their left side. They're labelled to help you understand the type of input expected.
Each node has one output circle on their right side (except for final nodes).
To join two nodes together, select an output circle on the first node, and then select an input circle on the second node. When you select a circle, only compatible circles will remain undimmed, so you can only create valid links!
All possible execution branches within the expression should end with a final node.
6 Save button
When you're finished, select Save to save your expression and return to the Item Form Builder. To leave without saving, select in the top-right corner.