Expressions and PhixScripts
Overview
PhixFlow sometimes needs code-like instruction to achieve dynamic behaviour. Usually these are simple, short pieces of code called Expressions. Longer, complex expressions are usually called Scripts. For useful expressions that you want to reuse in different places, you can put the expression into a Macro.
Expression Editor
Usually a dynamic field is expecting an expression. In some cases, a dynamic field expects different code, such as an SQL statement. If you want to use an expression in this type of field, enclose it in curly brackets.
Expressions can also include attributes or Internal Variables, depending on the context, which you create yourself. As these are prefixed with the $-symbol they are called $-variables.
To find out what code a dynamic field expects, or which internal variables are available, check the help for the properties tab in which you are working. At the top of the properties tab, click
PhixScript
Expression editors display symbols to indicate whether they are expecting
See Embedded Expressions.
Large Editor
When working on large expressions or scripts it can be useful to use the option,
As well as internal variables, PhixFlow has lots of Functions that you can use in expressions.
Learn More
The pages in this topic provide information on writing your own expressions, from simple assignments to complex looping operations.
Basic operations (+, -, *, /), $-variables, variable types, assignment statements, object types and commenting scripts. | |
A summary of the recommend scripting styles e.g. how to lay out an if clause and how best to name variables. | |
How to use variables in PhixFlow expressions. | |
A list of all the pre-defined variables in PhixFlow. Depending on the context of your expression, only some of these will be appropriate to use. | |
Information for including text strings in expressions, characters that have special meanings, and how to escape them. | |
How to use regular expressions that match strings in the data. | |
How to embed an expression within a statement or text. | |
How to conditionally control the flow of your script using the if() and switch() functions. | |
How to execute blocks of script a number of times. | |
Handling sets of data. | |
Create a series of unique identifiers. | |
Encapsulate an expression so you can reuse it in different places. | |
How to use paths to access files on the PhixFlow server. | |
How to handle invalid characters. | |
How to present all the PDFs produced by a file exporter as pages in a single PDF. | |
Information about how to extract data from binary files, if you need to load them using a file collector. | |
The full list of all the PhixFlow functions. For example the lookup function is for filters and dynamic lookups on Pipes. | |
A short list of commonly used functions. |