Skip to main content

Item Form Expression Builder

Build an expression visually

When you create or edit an expression, the Item Form Expression Builder will appear.

An overview of the Item Form Expressions Builder with key points numbered

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.

A global Boolean node added to the canvas

To set the value of a node, select its icon and then its Value field.

The unset Value field of a global Boolean value

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
VariableDescriptionGlobal node type
User Alloy IDThe ID of the current userAlloy ID Array
Item IDThe ID of the item being create/editedAlloy ID Array
Parent item IDThe IDs of any parent items that link to the item being created/editedAlloy ID Array
Create modeIs the item form being used to create an item?Boolean
Edit modeIs the item form being used to edit an item?Boolean
Date NowThe current dateDate
Date Time NowThe current date and timeDate Time
UsernameThe username of the current userString
First nameThe first name of the current userString
Last nameThe last name of the current userString
EmailThe email address of the current userString
Customer nameThe name of the current customer projectString
Item form nameThe name of the current item formString
Item form contextThe context of the current item formString
Design nameThe design name of the item being created/editedString
Design contextThe design context of the item being created/editedString
Item iconThe icon code of the item being created/editedString
Item signatureThe signature of the item being edited (changes with every edit)String
Item collectionThe Guc of the collection of the item being created/editedIsTriggering
Item form codeThe Guc of the current item formIsTriggering
Design codeThe Guc of the design of the item being created/editedIsTriggering
A list of possible values for a global Boolean node

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.

The Value field of a literal Boolean node set to true

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!

An AQS Transform node displaying three input circles and one output circle
Note

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.