> For the complete documentation index, see [llms.txt](https://sevenval.gitbook.io/flat/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sevenval.gitbook.io/flat/develop/reference/actions/set-env.md).

# set-env Action

Used in [FLAT tests](/flat/develop/reference/testing.md) to change the environment of the FLAT app under test.

Normally, env vars are set on server start-up and are immutable later on. They are available in the pre-defined variable [`$env`](/flat/develop/reference/variables.md#predefined-variables).

The action allows to override variables in the `$env` structure for testing purposes.

## Syntax

```markup
<set-env>
{
  "VAR_NAME": "VALUE",
  "BUILD_TIME": {{ unixtime() - 3600 }}
}
</set-env>
```

The action argument is a JSON Object. The property values should be of type string.

As env vars from the system (shell or `docker`) can only be strings, numeric or boolean values are cast to their *string representation*.

If the value is `null`, the env var is unset.

The action argument may be a [JSON template](/flat/develop/reference/templating.md).

## See also

* [`$env`](/flat/develop/reference/variables.md#predefined-variables) (reference)
* [Using Env Vars](/flat/develop/cookbook/envvars.md) (cookbook)
* [Testing](/flat/develop/reference/testing.md) (reference)
