> For the complete documentation index, see [llms.txt](https://docs.zerowork.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.zerowork.io/building-blocks/dynamic-inputs.md).

# Dynamic Inputs

Every input field of a building block is a dynamic input. Besides plain text, it accepts references to your data, code, and spintax, in any combination, e.g. "Hi {id: 1234, name: First name}, your entry code is ${Math.floor(Math.random() \* 9000) + 1000}."

### References to Variables and Tables

Click **V** (variables) or **T** (tables) at the top right of a building block and pick a variable or column. The reference is inserted as `{id: 1234, name: First name}` and replaced with its value when the block runs. See [Variables](https://docs.zerowork.io/variables/variables.md) and [Tables](https://docs.zerowork.io/tables/tables.md).

<figure><img src="https://3220183989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg9LcR8XM7TGOzOCDGsCS%2Fuploads%2Fi6MjFUtQpoqfVKBMMtly%2Fimage%20(3).png?alt=media&amp;token=c19ccf96-2754-4a1d-825c-d7dc3d9bb9a7" alt=""><figcaption></figcaption></figure>

### Code

* `${...}` is an expression. Its result is inserted.
* `$${...}` is a code block. It runs full code and must `return` the value to insert.

```
$${
  const axios = await zw.import("axios");
  const res = await axios.get("https://example.com/api/price");
  return res.data.price;
}
```

Code runs locally on your device and can use everything in the zw API. See [zw API: Overview](https://docs.zerowork.io/zw.-api/overview.md).

{% hint style="warning" %}
A reference is not code. It is replaced with its value as plain text before the code runs. Inside code, wrap it in quotes, as in `${"{id: 1234, name: Country Code}".toUpperCase()}`, or read the value with `await zw.getRef({ ref_id: 1234, name: "Country Code" })`.
{% endhint %}

<figure><picture><source srcset="https://3220183989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg9LcR8XM7TGOzOCDGsCS%2Fuploads%2Fgit-blob-aa239f5bb7364dd95d1f0e440160fc220734b3d7%2Finsert-text-code-dark.png?alt=media" media="(prefers-color-scheme: dark)"><img src="https://3220183989-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fg9LcR8XM7TGOzOCDGsCS%2Fuploads%2Fgit-blob-a66163f795dc0ef6566d3ad6f8347a1f48197334%2Finsert-text-code.png?alt=media" alt="A code expression in the Content field" width="555"></picture><figcaption></figcaption></figure>

### Spintax

Spintax varies your text at random, which helps on sites that check whether messages are unique. `{Hi|Hello|Hey} there` becomes "Hi there", "Hello there", or "Hey there", picked anew every time the block runs.

Spintax works in the [Insert Text or Data](https://docs.zerowork.io/building-blocks/web-interaction/insert-text-or-data.md) and [Update Data](https://docs.zerowork.io/building-blocks/data/update-data.md) blocks. In Update Data, check **Use spintax** first.
