# Decision-Trees-like data

**URL:** <https://forum.rasa.com/t/decision-trees-like-data/54490>\
**Category:** Rasa Open Source\
**Created:** [July 25, 2022, 11:01am UTC](https://forum.rasa.com/t/decision-trees-like-data/54490 "2022-07-25T11:01:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![BodaSadalla98](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/bodasadalla98/32/20581_2.png) [@BodaSadalla98](https://forum.rasa.com/u/BodaSadalla98)\
**Post date:** [July 25, 2022, 11:01am UTC](https://forum.rasa.com/t/decision-trees-like-data/54490/1 "2022-07-25T11:01:21Z")

</div>

I have multiple classes, and for each class, I have decision tree data ( every node has a question, and depending on the answer, it should ask for the next question). how can I implement this using rasa?

My idea is that I store the class in a slot and then open a form, but the following slots that I would need to fill would vary depending on the answers to the previous questions, so it’s now static. I have the questions texts and their answers stored in a database. I need to store the answers to the questions as well. the ideal solution is to somehow fire a question action, where I would ask a question, and get the answer, then ask the next question, and so on.

---

<div class="post-metadata">

**Author:** ![stephens](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/stephens/32/1632_2.png) [@stephens](https://forum.rasa.com/u/stephens)\
**Post date:** [July 26, 2022, 9:47pm UTC](https://forum.rasa.com/t/decision-trees-like-data/54490/2 "2022-07-26T21:47:58Z")

</div>

Have you tried implementing your use case with a dyanmic form and the `required_slots` method as described [here](https://rasa.com/docs/rasa/forms/#dynamic-form-behavior)?

---

<div class="post-metadata">

**Author:** ![BodaSadalla98](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/bodasadalla98/32/20581_2.png) [@BodaSadalla98](https://forum.rasa.com/u/BodaSadalla98)\
**Post date:** [July 27, 2022, 6:21am UTC](https://forum.rasa.com/t/decision-trees-like-data/54490/3 "2022-07-27T06:21:19Z")

</div>

I thought of using it, but when would then I would need for so many `ask_actions` to ask for the slots, as each slot would need a question and an answer, correct?

---

<div class="post-metadata">

**Author:** ![stephens](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/stephens/32/1632_2.png) [@stephens](https://forum.rasa.com/u/stephens)\
**Post date:** [July 27, 2022, 2:15pm UTC](https://forum.rasa.com/t/decision-trees-like-data/54490/4 "2022-07-27T14:15:33Z")

</div>

Yes
