Flow JSON enforces strict validation rules to ensure that configurations are correctly structured. One common validation issue developers encounter is the INVALID_PROPERTY_VALUE error. This error occurs when an unrecognized or extra property is included in the JSON structure. In this guide, we'll break down why this error happens, how to fix it, and best practices to avoid it.

What is the INVALID_PROPERTY_VALUE Error?

Error Code: INVALID_PROPERTY_VALUE

Error Message: Invalid value found for property (propertyName) at (errorPath).

Cause:

  • A property has been assigned a value that is not permitted in Flow JSON.

  • The value does not match the expected data type or format.

  • Only predefined values are allowed for specific properties.

Example of an Invalid Flow JSON File

{
   "layout": "myNewLayout"
}

Explanation

  • "layout" expects a predefined layout type, but "myNewLayout" is not recognized.

  • Using an invalid layout type triggers an INVALID_PROPERTY_VALUE error.

Another invalid example:

{
  "layout": {
    "type": "SingleColumnLayout",
    "children": [
      {
        "type": "newComponent"
      }
    ]
  }
}

Explanation

  • The component type "newComponent" is not defined in Flow JSON.

  • Only predefined component types are allowed.

How to Fix the INVALID_PROPERTY_VALUE Error

To resolve this error, follow these steps:

  1. Check the Allowed Property Values: Refer to the official Flow JSON documentation for valid values.

  2. Use Only Supported Values: Ensure all property values conform to the expected format and data type.

  3. Validate JSON Before Deployment: Run your JSON through schema validation tools to catch errors early.

Corrected Flow JSON Example

{
   "layout": {
      "type": "SingleColumnLayout",
      "children": []
   }
}

Here, an invalid component type has been removed, ensuring compliance.

Tip: Use JSON validation tools to catch errors early and always refer to official documentation before adding new properties.

For more insights related to WhatsApp Business API, check out heltar.com/blogs.