Expressions and PhixScripts
- Fiona Sargeant (Unlicensed)
- Zoe Baldwin
- Anthony George
- david.pearson
Overview
PhixFlow is a low-code, application-development platform. Using PhixFlow, you can create applications starting with the user interface, rather than requiring software developers to code all the functionality. However, PhixFlow sometimes needs code-like instruction to achieve the dynamic behaviour you need. This is done using expressions. Usually these are simple, short pieces of code. 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.
PhixFlow items have a Properties tab where you set the options for that item. You can see a list of the properties help pages for different items on the Properties, Windows, Menus and Toolbars page. Items where you may need to add some instructions have a field where you can enter an expression. These dynamic fields are often labelled as Expression.
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 variables. Some internal variables are defined in PhixFlow. The internal variables that you can use depends on the context. You can also create your own variables. 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 Help.
Large Editor
When working on large expressions or scripts it can be useful to use the option, Show field in a large editor. When working in the large editor, the content can be saved to the Properties tab without closing the larger editor window by clicking Save.
As well as internal variables, PhixFlow has lots of functions that you can use in expressions.
Functions
The pages in this topic provide information on writing your own expressions, from simple assignments to complex looping operations.
Expression Basics | Basic operations (+, -, *, /), $-variables, variable types, assignment statements, object types and commenting scripts. |
Expression Style | A summary of the recommend scripting styles e.g. how to lay out an if clause and how best to name variables. |
Using Variables | How to use variables in PhixFlow expressions. |
Internal Variables | 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. |
Text Expressions and Escape Characters | Information for including text strings in expressions, characters that have special meanings, and how to escape them. |
Regular Expressions | How to use regular expressions that match strings in the data. |
Embedded Expressions | How to embed an expression within a statement or text. |
Conditional Statements | How to conditionally control the flow of your script using the if() and switch() functions. |
Looping Statements | How to execute blocks of script a number of times. |
Arrays and Record Sets | Handling sets of data. |
Sequence | Create a series of unique identifiers. |
Macro | Encapsulate an expression so you can reuse it in different places. |
Referencing Files and Images Via a Soft Link | How to use paths to access files on the PhixFlow server. |
How to handle invalid characters. | |
Combining PDFs | How to present all the PDFs produced by a file exporter as pages in a single PDF. |
Binary File Grammar | Information about how to extract data from binary files, if you need to load them using a file collector. |
Functions | The full list of all the PhixFlow functions. For example the lookup function is for filters and dynamic lookups on Pipes. |
PhixScript Cheat Sheet | A short list of commonly used functions. |