Hi, I'm trying to use the new update-data
feature
I want to make it so that if you click on a button then a new CheckboxGroup
will be revealed and if you also click on it then another CheckboxGroup
will be revealed
This is my code:
{
"screens": [
{
"id": "test",
"title": "test",
"data": {
"checkbox_visibility_2": {
"type": "boolean",
"__example__": false
},
"checkbox_visibility_3": {
"type": "boolean",
"__example__": false
}
},
"terminal": true,
"layout": {
"type": "SingleColumnLayout",
"children": [
{
"type": "CheckboxGroup",
"name": "checkbox_1",
"data-source": [
{
"id": "1",
"title": "choose"
}
],
"label": "checkbox 1",
"on-select-action": {
"name": "update_data",
"payload": {
"checkbox_visibility_2": true
}
},
"on-unselect-action": {
"name": "update_data",
"payload": {
"checkbox_visibility_2": false
}
}
},
{
"type": "CheckboxGroup",
"name": "checkbox_2",
"data-source": [
{
"id": "1",
"title": "choose"
}
],
"label": "checkbox 2",
"required": "${data.checkbox_visibility_2}",
"visible": "${data.checkbox_visibility_2}",
"on-select-action": {
"name": "update_data",
"payload": {
"checkbox_visibility_3": true
}
},
"on-unselect-action": {
"name": "update_data",
"payload": {
"checkbox_visibility_3": false
}
}
},
{
"type": "CheckboxGroup",
"name": "checkbox_3",
"data-source": [
{
"id": "1",
"title": "choose"
}
],
"label": "checkbox 3",
"required": "${data.checkbox_visibility_3}",
"visible": "${data.checkbox_visibility_3}"
},
{
"type": "Footer",
"label": "Complete",
"on-click-action": {
"name": "complete",
"payload": {
"checkbox_1": "${form.checkbox_1}",
"checkbox_2": "${form.checkbox_2}",
"checkbox_3": "${form.checkbox_3}"
}
}
}
]
}
}
],
"version": "6.0",
"routing_model": {
"test": []
}
}
But when I press the first button - all the CheckboxGroup
are revealed even though the third CheckboxGroup
is currently set to False