# StateConditions

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Reference](https://developer.m-files.com/APIs/gRPC-API/Reference/index.md) > [Messages](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.StateConditions/

A structure for state rules i.e. preconditions or postconditions.

- **Full name:** `MFiles.StateConditions`
- **Proto file:** [`mfiles/structs.proto`](https://developer.m-files.com/APIs/gRPC-API/downloads/proto/mfiles/structs.proto)

<a id="fields"></a>

## Fields

| Field | Type | Number | Description |
|---|---|---|---|
| <a id="f-options"></a>`options` | [`STATECONDFLAGS`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.STATECONDFLAGS/index.md) | 1 | State condition flags. |
| <a id="f-search_conditions"></a>`search_conditions` | repeated [`SearchCondition`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SearchCondition/index.md) | 2 | Manual criteria. |
| <a id="f-code"></a>`code` | `string` | 3 | VBScript code. |

<a id="used-in-fields"></a>

## Used in fields

- [`State.preconditions`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.State/index.md#f-preconditions): State preconditions. (rules)
- [`State.postconditions`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.State/index.md#f-postconditions): State postconditions. (rules)
