# How to Fix INVALID_PROPERTY_VALUE: "Expected Single Operand to Be a Boolean" in WhatsApp Flows JSON
Author: Prashant Jangid
Author URL: https://www.heltar.com/blogs/author/prashant-jangid
Published: 2025-07-01
Category: Troubleshoot
Category URL: https://www.heltar.com/blogs/category/troubleshoot
Tags: WhatsApp Flows Error
Tag URLs: WhatsApp Flows Error (https://www.heltar.com/blogs/tag/whatsapp-flows-error)
URL: https://www.heltar.com/blogs/how-to-fix-invalidpropertyvalue-expected-single-operand-to-be-a-boolean-in-whatsapp-flows-json-cmckvsa9f002l2c4af1tr2kcg

If you're working with conditional components using JSON UI schema, you might come across this frustrating error:

**INVALID\_PROPERTY\_VALUE: Expected single operand to be a boolean.**

## Quick Fix

The condition in an If component must resolve to a boolean, not a string, number, or undefined variable. Here’s how to fix it:

```
{
  "type": "If",
  "condition": "${data.isActive === true}",
  "then": [...]
}
```

Or simply:

```
{
  "type": "If",
  "condition": "${Boolean(data.isActive)}",
  "then": [...]
}
```

## Why This Happens

The error usually appears when:

You’re referencing a string or undefined value directly:

```
"condition": "(${data.string_value})"
```

You hardcode a literal non-boolean value:

```
"condition": "true"
```

Both are syntactically valid strings, but the system expects a dynamic expression that evaluates to a boolean.

## What You Should Do Instead

Use logical comparisons or explicit conversions:

Incorrect

Correct

```
"condition": "(${data.string_value})"
```

```
"condition": "${data.string_value === 'yes'}"
```

```
"condition": "true"
```

```
"condition": "${true}"
```

```
"condition": "(${data.number})"
```

```
"condition": "${data.number > 0}"
```

```
"condition": "(${data.flag})"
```

```
"condition": "${Boolean(data.flag)}"
```

## Pro Tip

If you're unsure what a variable holds, log it out or add a **Text** component temporarily using:

```
{
  "type": "Text",
  "text": "${JSON.stringify(data)}"
}
```

This way, you can safely debug what **data.xyz** actually contains before using it in a condition.

Treat all conditions as JavaScript expressions inside "${...}". If you’re not explicitly returning true or false, you’re likely to hit this validation error. Always test your expression’s output and make sure it resolves to a boolean.

For more troubleshooting insights related to WhatsApp Business API, check out [heltar.com/blogs](https://www.heltar.com/blogs).


---
This blog is powered by Superblog. Visit https://superblog.ai to know more.
---

