# Value

> A literal source, the data domain's number box and message box.

Source: https://docs.tune.toys/nodes/data.value/

Value sends one fixed data value: a number, a piece of text, true or false, or a JSON value such as a list.

## What it does

Kind chooses what Value sends. Number sends the Number parameter. Text sends the node's text field as a string. Boolean sends true when Number is not 0 and false when it is 0. JSON parses the text field, so `[1, 2, 3]` becomes a list of three numbers; text that is not valid JSON sends no value (null) and the inspector shows the error.

Value sends when the Toy starts and again whenever you change Kind, Number or the text. Any message on the `send` input makes it send its current value again, so a trigger or a rising boolean can "bang" it.

## When to use it

Use it as the start of a data chain: a number for [Math](https://docs.tune.toys/nodes/data.math/), a sentence for [String](https://docs.tune.toys/nodes/data.string/), a list for [List](https://docs.tune.toys/nodes/data.list/), or the second operand of [Compare](https://docs.tune.toys/nodes/data.compare/). Use JSON to write a list literal.

## Ports

<!-- ports:start -->

| Port    | Direction | Signal     | Lanes |
| ------- | --------- | ---------- | ----- |
| `send`  | Input     | Data (any) | 1     |
| `value` | Output    | Data (any) | 1     |

<!-- ports:end -->

## Parameters

<!-- parameters:start -->

| Parameter | Label  | Range                     | Default | Unit | Scale  | Notes                                                                                                             |
| --------- | ------ | ------------------------- | ------- | ---- | ------ | ----------------------------------------------------------------------------------------------------------------- |
| `kind`    | Kind   | 0 to 3                    | 0       |      | linear | Datatype of the stored value; Text and JSON read the text data key. Choices: 0 Number, 1 Text, 2 Boolean, 3 JSON. |
| `number`  | Number | -1000000000 to 1000000000 | 0       |      | linear | The value when Kind is Number; non-zero is true for Boolean.                                                      |

<!-- parameters:end -->

<!-- data:start -->

- `text`: text.

<!-- data:end -->

### Kind (`kind`)

Number, Text, Boolean or JSON, a discrete choice. Text and JSON read the node's text field (up to 1 024 characters), which you edit in the inspector.

### Number (`number`)

The number to send, from -1 000 000 000 to 1 000 000 000, with no fixed step. Used by Number and Boolean; ignored by Text and JSON.

## Tips

- Write a list as JSON, for example `[60, 64, 67]`, and feed it to [List](https://docs.tune.toys/nodes/data.list/) or [Math](https://docs.tune.toys/nodes/data.math/).
- Text is sent exactly as typed, spaces included. Use [String](https://docs.tune.toys/nodes/data.string/) Trim to clean it.
- Connect a trigger to `send` to resend the value on an event.

## See also

[Math](https://docs.tune.toys/nodes/data.math/), [String](https://docs.tune.toys/nodes/data.string/), [List](https://docs.tune.toys/nodes/data.list/), [Compare](https://docs.tune.toys/nodes/data.compare/), [Cables](https://docs.tune.toys/concepts/cables/).
