If you're working with WhatsApp Flow JSON and see an error like this:
INVALID_DEPENDENCIES
Footer should have property left-caption when property right-caption is present.
—or the reverse:
Footer should have property right-caption when property left-caption is present.
It means your component is missing a required companion property. Let’s walk through what’s happening and how to fix it.
What This Error Means
This error shows up when a property depends on another one being present, but it’s not.
In this case, the Footer component expects that if you define either left-caption or right-caption, you must define both. They’re a pair.
The Problem
Here’s a Flow JSON example that will trigger the error:
{
"screens": [
{
"id": "FIRST_SCREEN",
"layout": {
"children": [
{
"type": "Footer",
"left-caption": "left",
"on-click-action": {
"name": "complete",
"payload": {}
}
}
]
}
}
]
}
What’s wrong here?
left-caption is defined.
right-caption is missing.
WhatsApp expects both if either one is used.
The Fix
To fix this, add the missing right-caption field, like so:
{
"screens": [
{
"id": "FIRST_SCREEN",
"layout": {
"children": [
{
"type": "Footer",
"left-caption": "left",
"right-caption": "right",
"on-click-action": {
"name": "complete",
"payload": {}
}
}
]
}
}
]
}
Now, the dependency is satisfied. No more error.
For more troubleshooting insights related to WhatsApp Business API, check out heltar.com/blogs.