ditdot-dev / vue-flow-form

Create conversational conditional-logic forms with Vue.js.
https://www.ditdot.hr/en/vue-flow-form
MIT License
779 stars 174 forks source link

Feature request: Callback to get another question from the server based on an answer #217

Open mrivasa opened 2 years ago

mrivasa commented 2 years ago

Describe the solution you'd like I would like to have an option to send an ajax callback to the server with the answer to a question to get the next question based on the selected answer.

Additional context I cannot use the jump alternative because the options for the next questions depend on what the user selects on the previous question. Ex. Question 1 - What is the car's make? --- go grab all the models for the selected make and display them as options of the next question. 2 - What's the model? .... etc.

spinn commented 2 years ago

@mrivasa,

if only the answers are dynamic, you could do this by defining your questions as components and making your :options parameter point to a data variable which you could populate in your answer event callback. Fully making questions dynamic and fetching all the parameters of the next question from the server could currently be problematic (or even impossible) because of how VFF determines if you've fully completed the survey.