Rich expressions syntax is used in flespi analytics and in plugins to define the conditions of their operation or to describe specific calculations to be performed. Expressions are powerful and flexible which sometimes makes them difficult to write and debug. The new expressions testing tool allows you to easily compose expressions and instantly see the result of their application to the selected data.
Let’s explore the tool in more detail.
The tool is integrated with Toolbox or can be opened as a standalone page.
The expressions testing tool works with messages, intervals, or logs.
Once in Toolbox (Logs & Messages tab for any entity), select one or multiple lines (multi-select works with SHIFT and CTRL/CMD buttons), right-click on the selection, and click Test expression menu item to open the tool.
Note: currently the tool allows selecting up to 100 records.
Use the input field on top to enter the expression to test.
If needed, refer to our comprehensive expression syntax reference. The tool automatically checks the syntax correctness and features parameter/function name auto-completion to minimize human error.
Once the expression is entered and if no syntax errors occur, wait a few seconds for it to apply to the selected record(s):
Note: if you edit the expression, it will automatically reapply after a few seconds pause.
- Show messages with result — only show messages that can be correctly matched against the expression, i.e. contain the parameters used in the expression. This option may be useful in identifying typos and missing parameters.
- Import — you can import the messages previously exported in JSON.
- Edit JSON — edit the added messages in JSON.
You can also edit the content of any individual cell by clicking on it.
If you heavily rely on flespi analytics or are a novice to this world, the new expressions testing tool will save you tons of time and nerve cells and will facilitate expressions writing for calculators and plugins. Try it when you need to compose your next expression.