When building WhatsApp flows, you may encounter this error:

INVALID_ON_CLICK_ACTION_PAYLOAD

Missing dynamic data '${expression}' in the data model for screen ${screenId}.

Data binding does not exist

This error means you're trying to use a dynamic value like ${data.something} in your action payload, but that value is not available in the screen’s data model.

Why This Happens

The error occurs when:

  • You reference a data field in ${data.field_name}, but that field was never defined or passed into the screen.

  • Your component is expecting to use data that isn’t available at runtime.

In other words, the screen doesn’t know what ${data.not_present} is because you haven’t provided it anywhere.

Problem Example

{
  "type": "Form",
  "name": "PASS_CUSTOM_VALUE",
  "children": [
    {
      "type": "Footer",
      "on-click-action": {
        "name": "complete",
        "payload": {
          "input": "${data.not_present}"
        }
      }
    }
  ]
}

Here, the payload references ${data.not_present}. But since not_present was never defined in the screen’s data model, the system throws an error.

How to Fix It?

To resolve this, you have two options depending on your intent:

Option 1: Pass the Required Data to the Screen

If you intend to use data from a previous step, make sure it’s explicitly included in the screen’s input data.

Example screen data model:

{
  "screen": {
    "id": "PASS_CUSTOM_VALUE",
    "data": {
      "custom_value": "user_input"
    }
  }
}

Then reference it in your component:

"input": "${data.custom_value}"

Option 2: Use Form Input Instead (If You Meant to Capture User Input)

If the data is supposed to come from the user via form input, you should reference ${form.input_name} instead.

Example:

{
  "type": "Form",
  "name": "PASS_CUSTOM_VALUE",
  "children": [
    {
      "type": "Input.Text",
      "name": "custom_value",
      "label": "Enter a value"
    },
    {
      "type": "Footer",
      "on-click-action": {
        "name": "complete",
        "payload": {
          "input": "${form.custom_value}"
        }
      }
    }
  ]
}

This ensures the payload references a value the user actually provides.

Key Differences Between ${form} and ${data}

Expression

Source

Use Case

${form.input}

User input from the current form

Collecting input from a user

${data.field}

Pre-populated data passed into the screen

Using existing data or values

The INVALID_ON_CLICK_ACTION_PAYLOAD error occurs when a payload references ${data.something} that doesn't exist in the screen’s data model. Make sure the value either exists in the screen’s input data or is collected via a form. Always double-check whether you're referencing data or form input and that the data is actually present and correctly named.


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