Spotlight feature: Create complex formulas easily with the formula editor

Imagine you are a production manager and would like to know which products with which serial number are available in your warehouse and in what quantities.  

In a monthly inventory, employees check exactly this data using barcode scanning and a specially developed smap. With formulas within your smap you can easily generate the desired information without much effort. The formulas required for this can now be edited even more conveniently with the new formula editor using its numerous aids. 

The smapOne Designer has a special editor that supports you in creating these formulas. This formula editor is automatically integrated in all input fields where formulas can be edited manually. The editor has a wide range of functions so that you can now use the right formulas even more intuitively. With the help of auto-completion and color highlighting, you also gain an improved orientation within the calculations.

 

The formula editor assists you during input with the following features

 

Large input window

If you are in the formula editor and the input field on the size of the right side is not sufficient, you can easily open the formula editor in a much wider input window by pressing the key F11 or by clicking the symbol at the end of the editor field. There you can edit long formulas more clearly.

Editor window

The large input window can be closed by pressing F11 again, by using ESC or by leaving the input field. 

 

Color highlighting

The individual components of a formula (functions, references, text, numbers, etc.) are highlighted in the formula editor. This makes orientation easier, especially for complex formulas.

Syntax highlighting

The following differentiation makes the operation of the formula editor easier:

  • Orange: shows metadata belonging to the smap, or modules references
  • Red: shows texts that you use in a formula
  • Blue: shows functions that are applied to references or text

 

The access to metadata has also been extended: You can now access metadata that is not available as module information, such as:

  • With "smap:version" you can access the version number 
  • With "const" fixed, constants can be included, e.g. the number Pi or another variable

 

An overview of the possible meta data can be found here in the formula documentation.

The generated data can be displayed in a smap or output in the reports.

 

Autocompletion

The editor supports the writing of formulas by auto-completion. As you enter data in the formula editor, it repeatedly displays a list of suggestions that may be useful at the current input position. For example, you can easily select functions or modules from your smap and columns from the data table of a data set selection module.

autocomplete formula editor

 

In this context the following shortcuts are useful:

  • Arrow keys: these help you to navigate through the suggestions
  • ENTER or TAB KEY: this allows you to transfer the selection to the formular
  • CTRL + SPACE KEY: opens the proposal list without having to enter a character first. If the proposal list does not open, no recommendations are available for the current input position. The more signs you enter in the editor, the more concrete the proposal list becomes.

Important: The formula editor helps you with choosing the right modules. If you want to use modules in your formula, which do not fulfill the necessary criteria to be used in the formula at the desired position, they are displayed paler than those ones, which can be used. You can still select them. However, this usually invalidates the formula.

 

Brackets

The formula editor helps you here as well. When you enter an opening bracket “(“ or “{“ the closing bracket is automatically inserted. Pairs of brackets that belong together are also highlighted if the input marker (cursor) is positioned on one of the two brackets.

 

Inserting Line Breaks

Line breaks in texts must be entered in formulas with \n. This can either be entered manually or the formula editor automatically adds the line break when you press ENTER.

 

formula editor - new line

 

Undo/ Redo

The formula editor has its own history, so that all changes made during editing can be undone with the key combination CTRL + Z. The key combination CTRL + Y easily restores undone changes.

Detailed information to read

A comprehensive overview of all described features and further details can be found in our documentation:

Documentation: New Area „Formular editor“
Documentation: More information about "Metadata“
Documentation: New area „Tips & tricks“