> For the complete documentation index, see [llms.txt](https://docs.coupler.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coupler.io/troubleshooting/data-sets-preview-troubleshooting-guide.md).

# Data sets (Preview) Troubleshooting Guide

### You're trying to use a string as a boolean

You may encounter the following error when using a formula in your data flow:

> You're trying to use a string as a boolean. Consider using a boolean expression or casting the value to boolean.

<figure><img src="https://2487187314-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FCgnmco7kCnvytNIN8YdT%2Fuploads%2FCFffcUKb0xnGBpgvoTS6%2Fimage.png?alt=media&amp;token=390da162-6128-4a85-bd5d-1b512357ac79" alt=""><figcaption></figcaption></figure>

This error occurs when a formula expects a **boolean** value (`TRUE` or `FALSE`), but receives a **string** instead.

For example, logical functions and operators such as `IF`, `!`, `AND()`,  `OR()` , etc. expect boolean values as their arguments. If the column you're using contains a string instead of actual boolean values, the formula may return this error.

**How to fix it**

1. Open the affected data flow and go to the Data sets section.
2. Check the formulas you've added. Formulas can be configured at both the ***data source and data set levels***, so make sure to review formulas in both places.
3. Look for logical functions or operators, such as:
   * `IF`
   * `!`
   * `AND()`
   * `OR()`
   * Other [logical functions](https://docs.coupler.io/functionality/preview-data/adding-formula-based-custom-columns#logical-functions)
4. Check the data type of the column used in the formula. Make sure it contains a boolean value rather than a string.
5. If the value is stored as a string, update your formula to use a boolean expression or convert the value to a boolean before using it in a logical function.\
   **Example**: One common case is when you have a formula like\
   `IF({{column}},1,0)` and the `{{column}}` is a string. This can trigger the error, so instead, you can specify `IF(LENGTH({{column}})>0,1,0)`


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.coupler.io/troubleshooting/data-sets-preview-troubleshooting-guide.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
