# rule_expression_from_gtv · FT4 Rell API · Chromia Docs (concept)

> function rule_ expression_ from_ gtv(gtv: gtv): rule_expression Takes a GTV representation of one rule, and converts it into a single rule_expression Throw

Source: https://docs.chromia.com/pages/ft4-rell/-f-t4-library/lib.ft4.core.accounts/rule_expression_from_gtv/

FUNCTION

# rule\_expression\_from\_gtv

```signature
function rule_expression_from_gtv(gtv: gtv): rule_expression
```

[Source](https://gitlab.com/chromaway/ft4-lib/-/blob/development/rell/src/lib/ft4/core/accounts/auth_descriptor_rule_validation.rell#lines-47)

Takes a GTV representation of one rule, and converts it into a single `rule_expression`

Throws `"INVALID RULE"` if the first component of the gtv can't be mapped into a
`rule_operator` value or the second one can't be mapped into a `rule_variable` value.

Throws if `gtv` is not the GTV representation of a rule, for example:

* it is not a `list`
* the first two components are not `text`s
* the last component is not an integer

**Parameters**

* **gtv** — the rule that should be deserialized

[View this page on docs.chromia.com](https://docs.chromia.com/pages/ft4-rell/-f-t4%20-library/lib.ft4.core.accounts/rule_expression_from_gtv.html)Generated API reference, mirrored from the live docs
