Substitutable Strings
Many parts of the Capture system allow you to replace text with the value of an attribute within your capture.
These will take any text in curly braces (between the '{' and '}' symbols), search for an attribute that matches that name, and replace the whole thing with the value of that attribute.
For instance, the following expression…
{Machine.Speed} > {Machine.Max Speed}
will become…
20 > 45
…when the value of 'Machine.Speed' is 20 and 'Max Speed' is 45.
Expressions generally follow PHP syntax.
Concatenating Strings
If you want to combine multiple strings together, use the period (.) symbol instead of the more traditional plus (+) symbol. Plus is only used for numeric addition.
For example, if we wanted to create a single attribute combining the style, flavour and size of the cupcake we are baking, the expression would be…
{Product.Style}.'/'.{Product.Size}.'/'.{Product.Flavour}
…which would result in values such as 'Plain Large Banana' and 'Gluten-Free Mini Chocolate'.
Equality
Use double-equals ( == ) to check for values being equal.
Functions
You can call PHP functions in calculations.
These include…
abs(amount) - Returns the absolute value of the number
round(amount,places) - Rounds the value to the given number of decimal places
sqrt(amount) - Returns the square root of the result
A number of functions are prohibited for security reasons. These include…
eval, system, passthru, exec, file_get_contents, open, readfile etc.