The MIN_ITEMS_REQUIRED and MIN_CHARS_REQUIRED errors occur when a property in your Flow JSON does not meet the required minimum length or item count. These errors indicate that a field is either empty or does not contain enough elements to be valid.

Error Message Examples

  • MIN_ITEMS_REQUIRED: Property '${propertyName}' should have at least '${minQuantityCount}' ${quantityUnit}.
  • MIN_CHARS_REQUIRED: Property '${propertyName}' should have at least '${minQuantityCount}' ${quantityUnit}.

Understanding the Issue

Example 1: MIN_CHARS_REQUIRED

{
  "screens": [
    {
      "id": ""
    }
  ]
}

Here, the id property is required to have at least one character, but it is empty ("").

Example 2: MIN_ITEMS_REQUIRED

{
  "version": "2.1",
  "screens": []
}

In this case, the screens array is empty, but it must contain at least one item.

Common Causes of These Errors

  1. Empty Strings in Required Fields

    • Incorrect: "id": ""

    • Correct: "id": "screen_123"

  2. Missing Items in Arrays

    • Incorrect: "screens": []

    • Correct: "screens": [{ "id": "screen_1" }]

  3. Forgetting to Populate Required Fields

    • Ensure that all required fields contain valid values before submitting the JSON.

How to Fix These Errors

  • Check the Error Message: Identify whether the issue is a missing character count or a missing array item.

  • Review the Required Minimums: Refer to the Flow JSON documentation to understand the required values.

  • Update the JSON: Ensure all fields contain valid data with the required minimum characters or items.

Fixed JSON Examples

Fix for MIN_CHARS_REQUIRED

{
  "screens": [
    {
      "id": "screen_1"
    }
  ]
}

Fix for MIN_ITEMS_REQUIRED

{
  "version": "2.1",
  "screens": [
    {
      "id": "screen_1"
    }
  ]
}

By following these steps, you can prevent MIN_ITEMS_REQUIRED and MIN_CHARS_REQUIRED errors and ensure your Flow JSON is properly formatted.

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