Conditional based showing sections on based of answers selected in ember octane

50 Views Asked by At

I have a JSON Data with multiple section where sections will be shown on user click of next button one after other .Here I am need to add condition (for example : if user is selected yes in section 1 for a question and in section 3 we will add condition as where condition will will have question and value if value is yes and for the same question . Now after selecting all field and on click of next user need to skip section 2 and show him section 3 ) . As I am very new to ember octane struck with this particular issue

{
    "deadline": "2020-10-02T09:30:13+05:30",
    "formType": "One time",
    "questions": [
        {
            "condition": {},
            "questions": [
                {
                    "type": "currency",
                    "options": [
                        ""
                    ],
                    "helpText": "",
                    "question": "How Many Products do you sell",
                    "required": false,
                    "indicator": "dfsff_0_0",
                    "responseType": "number"
                },
                {
                    "type": "boolean",
                    "options": [
                        ""
                    ],
                    "helpText": "",
                    "question": "Are you in profits",
                    "required": false,
                    "indicator": "dfsff_0_1",
                    
                },
                {
                    "type": "dropdown",
                    "options": [
                        "sdsd",
                        "sdsdddsd"
                    ],
                    "helpText": "",
                    "question": "dsds",
                    "required": false,
                    "indicator": "dfsff_0_2",
                    "responseType": ""
                }
            ],
            "sectionTitle": "section 1"
        },
        {
            "condition": {
                "value": "true",
                "indicator": "dfsff_0_1"
            },
            "questions": [
                {
                    "type": "date",
                    "options": [
                        ""
                    ],
                    "helpText": "",
                    "question": "Loss ?",
                    "required": true,
                    "indicator": "trewq_1_0",
                    "responseType": ""
                },
                {
                    "type": "boolean",
                    "options": [
                        ""
                    ],
                    "helpText": "",
                    "question": "",
                    "required": false,
                    "indicator": "trewq_1_1",
                    "responseType": ""
                }
            ],
            "sectionTitle": "section 2"
        },
        {
            "condition": {
                "value": "false",
                "indicator": "trewq_1_1"
            },
            "questions": [
                {
                    "type": "currency",
                    "options": [
                        ""
                    ],
                    "helpText": "dsds",
                    "question": "dsdsd",
                    "required": true,
                    "indicator": "dsd_2_0",
                    "responseType": "number"
                }
            ],
            "sectionTitle": "section 3"
        }
    ]
}
0

There are 0 best solutions below