Why my checkbox group array items are not always referenced
1

In my flow I have 8 screens. in the screen of "DISEASES_SCREEN" its having a checkbox group called "diseases" that the user is selecting from. And in the next screen of "DISEASES_DATES" I have 3 dropdown list (User should go only to this screen if user made a certain choice in the DISEASES_SCREEN)

each dropdown's label in the "DISEASES_DATES" shows one of the user selections in the "DISEASES_SCREEN" screen as per my code.

This code was working successfully and I was able to send it to my personal WhatsApp to test it. but then I did a very tinny change then hit save it shows me the error in the attached screen.

I tried to undo my change but it still showing this weird error although it works as expected in the preview screen as you can see in the attached screen.

I spent hours and hours and hours to try to fix it and still no way!

The first screen

{
            "id": "DISEASES_SCREEN",
            "title": "${screen.PROFILE_SCREEN.data.screen_2_title}",

            "layout": {
                "type": "SingleColumnLayout",
                "children": [

{
                        "type": "Form",
                        "name": "form",
                        "children": [

                            {
                                "type": "TextSubheading",
                                "text": "${screen.PROFILE_SCREEN.data.diseases_label}"
                            },

{
    "type":"RadioButtonsGroup",
    "name": "have_diseases",
    "label": "${screen.PROFILE_SCREEN.data.have_diseases}",
     "required":true,
    "data-source":[
        {"id":"Yes","title": "${screen.PROFILE_SCREEN.data.yes}"},
        {"id":"No","title": "${screen.PROFILE_SCREEN.data.no}"}
    ]
},


{
"type":"If",
"condition": "(${form.have_diseases}=='Yes')",
"then": [
{
                                "type": "CheckboxGroup",
                                "label": "${screen.PROFILE_SCREEN.data.select_disease}",
                                "required": true,
                                "name": "diseases",
                                "data-source": "${screen.PROFILE_SCREEN.data.diseases_list}"

                            }
]
}
          ,

{
  "type": "If",
  "condition": "(${form.have_diseases}=='Yes')",
  "then": [

                            {
                                "type": "Footer",
                                "label": "${screen.PROFILE_SCREEN.data.continue}",
                                "on-click-action": {
                                    "name": "navigate",
                                    "next": {
                                        "type": "screen",
                                        "name": "DISEASES_DATES"
                                    },
                                    "payload": {
                                    }
                                }
                            }
  ],
  "else": [

                            {
                                "type": "Footer",
                                "label": "${screen.PROFILE_SCREEN.data.continue}",
                                "on-click-action": {
                                    "name": "navigate",
                                    "next": {
                                        "type": "screen",
                                        "name": "FAMILY_DISEASES_SCREEN"
                                    },
                                    "payload": {
                                    }
                                }
                            }
  ]
}

                        ]}]
                    }

            }

The second screen:

{
"id": "DISEASES_DATES",
"title": "${screen.PROFILE_SCREEN.data.screen_since_when_title}",
"layout": {
"type":"SingleColumnLayout",
"children": [

{
                                "type": "TextSubheading",
                                "text": "${screen.PROFILE_SCREEN.data.since_when}"
                            },

{
                    "type": "Dropdown",
                    "label": "${screen.DISEASES_SCREEN.form.diseases}[0]",
                    "name": "firstDiseaseSince",
                    "required": true,            
                    "data-source": "${screen.PROFILE_SCREEN.data.since_list}"
                          }
,
{
                    "type": "Dropdown",
                   "label": "${screen.DISEASES_SCREEN.form.diseases}[1]",
                    "name": "secondDiseaseSince",
                    "required": false,            
                    "data-source": "${screen.PROFILE_SCREEN.data.since_list}"
                          }
,

{
                    "type": "Dropdown",
                   "label": "${screen.DISEASES_SCREEN.form.diseases}[2]",
                    "name": "thirdDiseaseSince",
                    "required": false,            
                    "data-source": "${screen.PROFILE_SCREEN.data.since_list}"
                          },


{
                                "type": "Footer",
                                "label": "${screen.PROFILE_SCREEN.data.continue}",
                                "on-click-action": {
                                    "name": "navigate",
                                    "next": {
                                        "type": "screen",
                                        "name": "FAMILY_DISEASES_SCREEN"
                                    },
                                    "payload": {
                                    }
                                }
                            }


]



}


}
Tamer
質問日時: 約3ヶ月前
選択された回答
1

Hi Tamer, I'm not sure why it ever worked for you, but the nested expression like "${screen.DISEASES_SCREEN.form.diseases}[0]" is not currently supported. Please keep an eye on our public documentation at https://developers.facebook.com/docs/whatsapp/flows/reference/flowjson#flow-json and you'll see it once it's officially supported.

9月19日 4:10
Quanfu
Tamer

Thanks for your answer, but what do you mean by nested expression? I have in my flow a lot of expressions like ${screen.<screen_name>.(form | data).} and this is mentioned already in the documentation that you shared. But what Im trying to do now is to reference an item in the checkboxgroup array "diseases" in position zero. This one was working great and I sent it to my phone to test, but now not working any more. no idea!

9月19日 9:14
Quanfu

The expressions like ${screen.<screen_name>.(form | data).<field-name>} are supported, and you can find usage examples in the public documentation.

However, other expressions such as array references like ${screen.SCREEN_A.form.checkbox_values}[0] or combinations with strings like 'hello ${screen.SCREEN_A.form.some_field}' are not yet supported. Therefore, you should not expect them to work until they are officially announced as supported in the public documentation.

9月20日 2:04