# How to Fix “COMPONENTS_OUTSIDE_FORM” Error in Flow Configs on WhatsApp API
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-componentsoutsideform-error-in-flow-configs-on-whatsapp-api-cmckpmaui00252c4adb5z42uy

When building screens in your flow configuration, it’s tempting to drop input components like **TextInput** directly into the layout. But if your screen already contains a **Form**, all such components must be nested inside it.

Here’s what not to do:

```
{
  "type": "TextInput",
  "name": "path2",
  "label": "Path"
},
{
  "type": "Form",
  "name": "flow_path",
  "children": [
    {
      "type": "TextInput",
      "name": "path",
      "label": "Path"
    }
  ]
}
```

In the example above, the first **TextInput** is outside the **Form**, which will trigger the error:

**COMPONENTS\_OUTSIDE\_FORM**

## Why This Happens

When a **Form** is present, all form components (anything that collects user input) are expected to be inside it. This ensures data validation, submission handling, and component grouping work correctly.

## Correct Structure

Wrap all user input components inside the **Form**:

```
{
  "type": "Form",
  "name": "flow_path",
  "children": [
    {
      "type": "TextInput",
      "name": "path",
      "label": "Path"
    },
    {
      "type": "TextInput",
      "name": "path2",
      "label": "Path"
    }
  ]
}
```

This will resolve the error and ensure your form behaves as expected.

## TL;DR

If you're using a Form component on a screen, all input components like TextInput, Select, Checkbox must be placed inside that Form. No input component should exist outside the Form. If you need multiple groups, consider structuring your UI with multiple screens or logic branches, not by placing components outside the form.

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

