# Expression Editor

**Expressions** are an important and powerful tool that allows you to avoid using additional unnecessary blocks and perform various arithmetic calculations, string operations, and use built-in functions directly in the place where such a need arises (all within a property).

## **Edit Expressions**

For convenience when working with expressions, use the "Edit Expressions" window. This window can be opened from the Block Properties Panel by clicking on the ellipsis next to any property that supports the use of expressions.

<figure><img src="https://3199517203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4mXXYsqBuhj7RyX6Y4Yw%2Fuploads%2Fgit-blob-91364b12eafd699dabd133742c7a7de64116ac65%2F%D0%A0%D0%B5%D0%B4%D0%B0%D0%BA%D1%82%D0%92%D1%8B%D1%80%D0%B6%D0%BD.png?alt=media" alt=""><figcaption></figcaption></figure>

The "Edit Expression" window is designed to create expressions that can be used as conditions for checks, formulas for calculating values, etc. The editor allows you to create and edit previously created expressions without involving system developers, by a trained user or administrator. At the bottom of this window, there is help on functions. Select a category of functions and the function itself to see a hint on how to use it in an expression. Double-click on the function or an example of using the expression to insert it into the currently edited expression.

Clicking this button opens the "Edit Expression" window. Here you can set a constant corresponding to the type of data that the property expects.

<figure><img src="https://3199517203-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4mXXYsqBuhj7RyX6Y4Yw%2Fuploads%2Fgit-blob-41cc48d0b34af21e75ed1a8d656b3c50db8d520e%2Fimage%20(143).png?alt=media" alt=""><figcaption></figcaption></figure>

The Expression Editor also allows you to specify a path to a folder or file in the expression editing field. To do this, right-click on the expression editing field and select one of the options from the context menu:

* “Select folder path…”;
* “Select file path…”.

The path will be inserted into the window at the current cursor position.

<figure><img src="https://docs.sherparpa.ru/~gitbook/image?url=https%3A%2F%2F483167589-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FpyvTUnAaOD3OMZ1w2jM6%252Fuploads%252FwtdbZIa4fRXvFCp7K1cA%252F%25D0%25B8%25D0%25B7%25D0%25BE%25D0%25B1%25D1%2580%25D0%25B0%25D0%25B6%25D0%25B5%25D0%25BD%25D0%25B8%25D0%25B5.png%3Falt%3Dmedia%26token%3D9cdf345d-4bd2-4202-9b41-aede1bad27f7&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=135cffe5&#x26;sv=2" alt=""><figcaption></figcaption></figure>

## **Structure of Expressions**

Expressions in the system are used to impose various conditions on data when searching for data, selecting data for reports, checking the correctness of data entry, etc. Expressions can be written in the form of mathematical functions, dates, and arbitrary expressions (written in an expression language similar to PowerShell). Constants, variables, mathematical functions, or methods can be used in expressions.

When you use an expression in a Block property, at the moment when the execution of the scenario reaches this Block, the values of the expressions are calculated, taking the current values of all variables used in the expression. The result of the expression calculation is used as the value of the property in which this expression was written.

Properties located in the Output section do not allow the use of expressions. You must write the name of the variable into which the Block should place the result of its work.

The InvokeExpression Block in the Expression properties allows the use of extended format expressions that are similar to expressions in the PowerShell scripting language. These can also include explicit assignments. The expression is written as $VariableName, followed by an equals sign (=), and then the value you want to assign. To specify a variable, use the dollar sign $. To assign values to variables, use the assignment operator “=”.

## Video

Working with IntelliSense hints in the Expression Editor is demonstrated here:

{% embed url="<https://sherparpa.ru/ucontent/?g8ES>" %}
