I’m building a WhatsApp Flow and using a CalendarPicker component. I need to dynamically restrict the selectable days (e.g., weekdays only). However, when I define include-days as a dynamic value in the data section, it doesn’t work.
Here’s the JSON I tried:
"include_days": {
"type": "array",
"items": {
"type": "string"
},
"__example__": ["Mon", "Tue", "Wed", "Thu", "Fri"]
}
And referenced it in the CalendarPicker as:
"include-days": "${data.include_days}"
This throws an error, and the component doesn’t render properly. Static values like [“Mon”, “Tue”, “Wed”, “Thu”, “Fri”] work fine, but I need this to be dynamic. Is there a limitation with include-days in WhatsApp Flows, or is there a different way to make it dynamic?
Here is the doc from whatsapp official https://developers.facebook.com/docs/whatsapp/flows/reference/components#calendarpicker
here is the doc from whatsapp official
Complete example here:
{
"routing_model": {
"calendar_screen": []
},
"data_api_version": "3.0",
"version": "6.2",
"screens": [
{
"id": "calendar_screen",
"title": "Seleccionar Fecha",
"terminal": true,
"data": {
"min_date": {
"type": "string",
"__example__": "2024-12-01"
},
"max_date": {
"type": "string",
"__example__": "2025-12-31"
},
"unavailable_dates": {
"type": "array",
"items": {
"type": "string"
},
"__example__": ["2024-12-25", "2025-01-01"]
},
"include_days": {
"type": "array",
"items": {
"type": "string"
},
"__example__": ["Mon", "Tue", "Wed", "Thu", "Fri"]
}
},
"layout": {
"type": "SingleColumnLayout",
"children": [
{
"type": "CalendarPicker",
"name": "appointment_date",
"label": "Selecciona una fecha",
"helper-text": "Selecciona una fecha disponible.",
"required": true,
"mode": "single",
"min-date": "${data.min_date}",
"max-date": "${data.max_date}",
"unavailable-dates": "${data.unavailable_dates}",
"include-days": "${data.include_days}",
"on-select-action": {
"name": "data_exchange",
"payload": {
"appointment_date": "${form.appointment_date}"
}
}
},
{
"type": "Footer",
"label": "Finalizar",
"on-click-action": {
"name": "complete",
"payload": {}
}
}
]
}
}
]
}
Nino is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.