> For the complete documentation index, see [llms.txt](https://docs.monokot.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.monokot.io/scripts/api/expression.md).

# Expression

The Expression object is intended for obtaining information about the expression being executed at the moment.

### Fields <a href="#h.vklr5kew49n5" id="h.vklr5kew49n5"></a>

| **Name**     | **Description**                                                                                                                |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------ |
| id           | Contains ID (name) of the expression (string).                                                                                 |
| uid          | Contains global ID of the expression (string).                                                                                 |
| path         | Contains path to the expression (string).                                                                                      |
| currentState | Contains an object of [ValueState](/scripts/api/valuestate.md) type and is the result of the last execution of the expression. |
| comment      | Contains a comment for the expression.                                                                                         |

### Examples <a href="#h.p07m351ugldw" id="h.p07m351ugldw"></a>

In the following example, all expressions located in the *Alarms → Area1* group will return *True*, the rest will return *False*.

```javascript
if (context.expression.path.startsWith('Alarms.Area1'))
  return false;
return true;
```

In the example below, the expression will return *True* if the previous result was *False*, otherwise it will return *True*.

```javascript
if (context.expression.currentState.value == false)
  return true;
return false;
```
