Product: Whatsapp Feature: Flow JSON Version: 6.0 and 6.1 Issue: Can't set dynamic init-values on form Other versions: It works on previous versions like 5.0 and 4.0
I'm trying to use form init-values like this: { "init-values": { "user": "${data.user}" } }
But as soon as I type in, I get this error: "Flow JSON is not valid. Invalid schema found for the given version 601."
Changing the version to 5.0 automatically fixes the issue.
As soon as you change the version the error goes away.
And as soon as you remove the 'meals-per-day' init value, it starts working on version 6.0 (or 6.1).
MWE:
{
"version":"6.0",
"data_api_version":"3.0",
"routing_model":{
"BURGERS":[
]
},
"screens":[
{
"id":"BURGERS",
"title":"Burgers",
"success":true,
"terminal":true,
"data":{
"init_burger":{
"type":"string",
"__example__":"6"
},
"burgers":{
"type":"array",
"items":{
"type":"object",
"properties":{
"id":{
"type":"string"
},
"title":{
"type":"string"
},
"description":{
"type":"string"
},
"metadata":{
"type":"string"
}
}
},
"__example__":[
{
"id":"1",
"title":"Good burger",
"description":"Good burger"
}
]
}
},
"layout":{
"type":"SingleColumnLayout",
"children":[
{
"type":"Form",
"name":"appointment_form",
"init-values":{
"burgers":"${data.init_burger}"
},
"children":[
{
"type":"TextSubheading",
"text":"Burgers"
},
{
"type":"Dropdown",
"name":"burgers",
"label":"Choose",
"required":true,
"data-source":"${data.burgers}"
},
{
"type":"Footer",
"label":"Next",
"on-click-action":{
"name":"data_exchange",
"payload":{
}
}
}
]
}
]
}
}
]
}
Hi Fernando, thanks for the detailed description. We're preparing a fix for it and I will post here as soon as the fix is out.
As far as i can see in documentation, the init values are available only outside Form component.
Only available when component is outside Form component
Hope it helps.
That would be the 'init-value' property, the issue is happening with the 'init-values' one.
You can check out on the flow json docs: https://developers.facebook.com/docs/whatsapp/flows/reference/flowjson