# How Fix “INVALID_PROPERTY_VALUE” in ‘If’ Component: Expected array to contain at least one component
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-fix-invalidpropertyvalue-in-if-component-expected-array-to-contain-at-least-one-component-cmcktmjww002g2c4awgvv7vs4

**Solution:**

Make sure the **"then"** array inside your If component contains at least one valid UI component. An empty array will trigger the **INVALID\_PROPERTY\_VALUE** error.

When working with conditional rendering in a Flow JSON layout, it's easy to overlook the content inside an If component, especially during refactoring or experimentation. But if you define an If block like this:

```
{
  "type": "If",
  "condition": "${data.val}",
  "then": []
}
```

You’ll hit the error:

**INVALID\_PROPERTY\_VALUE**

**Expected array to contain at least one component.**

This happens because the **"then"** key must contain a non-empty array of UI components to render when the condition is true. Leaving it empty is considered invalid.

### Fix Example:

Update your then block to include at least one valid component. For example:

```
{
  "type": "If",
  "condition": "${data.val}",
  "then": [
    {
      "type": "Text",
      "text": "Condition met!"
    }
  ]
}
```

This ensures the Flow has something meaningful to render when data.val is true.

## Pro Tips:

- Don’t leave **then: \[\]** empty.

- Always provide at least one child component inside **then**.

- This applies to **else** too if used.


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.
---

