> For the complete documentation index, see [llms.txt](https://docs.atfinity.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.atfinity.io/rule-language/operators/boolean-operators/truthy.md).

# truthy

{% hint style="info" %}
**New in Atfinity 17.**
{% endhint %}

### Description

`truthy` converts a value into a boolean, returning `true` only for values that clearly represent "true". It is useful when a value comes in as a number or a string (for example from an imported field) and you want to interpret it as a boolean.

`truthy` returns `true` for:

* the boolean `true`
* the number `1`
* the strings `"1"` and `"true"` — case-insensitive and trimmed of surrounding whitespace (so `" TRUE "` also counts)

For **any other value** it returns `false`. In particular, numbers other than `1` (such as `2`) and unrecognised strings (such as `"yes"` or `"maybe"`) are **not** truthy.

If the value is `unknown`, the result is `unknown`.

{% hint style="warning" %}
`truthy` and [`falsy`](/rule-language/operators/boolean-operators/falsy.md) are not exact opposites. A value like `2` or `"maybe"` is **neither** truthy nor falsy — both operators return `false` for it.
{% endhint %}

### Examples

```
truthy(true)        // => true
truthy(1)           // => true
truthy('1')         // => true
truthy('true')      // => true
truthy('  TRUE  ')  // => true

truthy(false)       // => false
truthy(0)           // => false
truthy(2)           // => false
truthy('maybe')     // => false
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.atfinity.io/rule-language/operators/boolean-operators/truthy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
