> ## Documentation Index
> Fetch the complete documentation index at: https://nocode-docs.zeroagent.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Environment variables

In Zeromagic, you can effortlessly access variables and values from one block in other blocks. Each action block in Zeromagic has a predefined data structure, specifying the format and structure of the data it generates. This data structure is detailed in the documentation for each action block.

Zeromagic offers multiple options to access the outputs generated by other action blocks.

## Accessing Variable Data

All variables defined in the workflow can be easily accessed in other blocks. To access a defined variable, use

```jsx theme={null}
{{$variable.var-name}}
```

For instance, if you define a variable named **myvar** in a Declare Variable block, you can access it using `{{$variable.myvar}}`.

## Accessing Block Data

1. **Action Block:** To access data from any other action block, regardless of its position in the workflow, use the following syntax:

```jsx theme={null}
{{$action-name.val}}
```

where `action-name` is the name of the action block you want to retrieve the outputs from, and `val` is the output value of that block.

For example, to access the outputs of an action block named **createOne**, you would use `{{$createOne.val}}`.

<Note>
  Spaces are not allowed in the action block name.
</Note>

2. **API Endpoint Action Block:** The `API Endpoint` returns headers, body, params and queryparams. You can access the outputs of this block by

* ***Headers***: Information sent along with the request, like authentication details.

```jsx theme={null}
{{$request.header.header-name}}
```

* ***Body***: The main content of the response from the website/service.

```jsx theme={null}
{{$request.body.key-name}}
```

* ***Params***: Specific details included in the URL path (like page numbers or IDs).

```jsx theme={null}
{{$request.params.param-name}}
```

* ***QueryParams***: Additional details added to the URL after a question mark (?).

```jsx theme={null}
{{$request.queryParams.queryparam-name}}
```

3. **HTTP Request Action Block:** The `HTTP Request` returns response and status. You can access the outputs of this block by

```jsx theme={null}
{{$action-name.status}}
{{$action-name.val}}
```

## Accessing Secrets Data

All the secrets defined in the `Secrets` section of the Project console can be accessed in the workflow. If you need to use a secret in your workflow, you can access it using the following syntax:

```jsx theme={null}
{{$secrets.secret-name}}
```

Replace secret-name with the actual name you gave to the secret when you stored it.
