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

# Bool Block

> Output a boolean constant or convert an input value into a boolean

## Overview

The Bool Block is used to output a boolean constant or convert an input value into a boolean. It's particularly useful when you need to create a boolean value for use in other blocks, such as the [If Block](/block-reference/logic/if-else) or [If/Else Block](/block-reference/logic/if-else).

<Frame>
  <img src="https://mintcdn.com/odella/MNHyQg3-ZFMTYSp3/block-reference/assets/bool_light.png?fit=max&auto=format&n=MNHyQg3-ZFMTYSp3&q=85&s=7e5b0cbe0eb7b4243005c844b1946875" alt="Bool Block Screenshot" className="block dark:hidden" width="502" height="328" data-path="block-reference/assets/bool_light.png" />

  <img src="https://mintcdn.com/odella/MNHyQg3-ZFMTYSp3/block-reference/assets/bool_dark.png?fit=max&auto=format&n=MNHyQg3-ZFMTYSp3&q=85&s=407e1b407874443f3a46677d9335035a" alt="Bool Block Screenshot" className="hidden dark:block" width="574" height="368" data-path="block-reference/assets/bool_dark.png" />
</Frame>

## Inputs

<ParamField path="Input" type="any">
  The value to be converted to a boolean. This input is only available if "Use Value Input" is enabled.
</ParamField>

## Outputs

<ResponseField name="Value" type="boolean">
  The boolean value. If "Use Value Input" is enabled, this will be the input value converted to a boolean. Otherwise, outputs the constant value specified in settings.
</ResponseField>

## Editor Settings

<ParamField path="Value" type="boolean" default={false}>
  The constant boolean value to output. This setting is only available if "Use Value Input" is disabled.
</ParamField>

<ParamField path="Use Value Input" type="boolean" default={false}>
  If enabled, the block will convert an input value to a boolean. If disabled, the block will output the constant boolean value specified in the Value setting.
</ParamField>

<ParamField path="Width" type="number" default={130}>
  The width of the block in pixels.
</ParamField>

<ParamField path="Hidden" type="boolean" default={true}>
  Whether the block is hidden in the block menu.
</ParamField>

## Conversion Rules

The Bool Block follows JavaScript's rules for truthy and falsy values when converting input values to booleans. If no input is connected when "Use Value Input" is enabled, it will fall back to using the Value setting.

## Example: Using a Constant Boolean Value

1. Add a Bool Block to your flow.
2. Set the `Value` setting to `true`.
3. Run the flow. The `Value` output of the Bool Block will be `true`.

## Example: Converting an Input to a Boolean

1. Add a Bool Block to your flow.
2. Enable the `Use Value Input` setting.
3. Add a [Text Block](/block-reference/data/text) to your flow and set the text to `"Hello"`.
4. Connect the output of the Text Block to the `Input` of the Bool Block.
5. Run the flow. The `Value` output of the Bool Block will be `true`, because the string `"Hello"` is a truthy value in JavaScript.

## Error Handling

The Bool Block cannot error under normal circumstances. If "Use Value Input" is enabled and no input is connected, the block will fall back to using the Value setting.

## FAQ

<AccordionGroup>
  <Accordion title="What values are considered truthy and falsy in JavaScript?">
    The following values are considered falsy:

    * `false`
    * `0`
    * `''` (empty string)
    * `null`
    * `undefined`
    * `NaN`

    All other values are considered truthy.
  </Accordion>

  <Accordion title="What happens if no input is connected when Use Value Input is enabled?">
    The block will fall back to using the Value setting specified in the editor settings.
  </Accordion>
</AccordionGroup>

## See Also

* [If Block](/block-reference/logic/if-else)
* [Match Block](/block-reference/logic/match)
* [Text Block](/block-reference/data/text)
* [Array Block](/block-reference/data/array)
* [Number Block](/block-reference/data/number)
