# 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;
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.monokot.io/scripts/api/expression.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
