# How to get input from user in the middle of FormAction

**URL:** <https://forum.rasa.com/t/how-to-get-input-from-user-in-the-middle-of-formaction/17112>\
**Category:** Rasa Open Source\
**Created:** [September 23, 2019, 12:39pm UTC](https://forum.rasa.com/t/how-to-get-input-from-user-in-the-middle-of-formaction/17112 "2019-09-23T12:39:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kpreetsid](https://avatars.discourse-cdn.com/v4/letter/k/779978/32.png) [@kpreetsid](https://forum.rasa.com/u/kpreetsid)\
**Post date:** [September 23, 2019, 12:39pm UTC](https://forum.rasa.com/t/how-to-get-input-from-user-in-the-middle-of-formaction/17112/1 "2019-09-23T12:39:58Z")

</div>

Hi, I’m using FormAction to collect information from user and filling few slots with that. Below is the screen of action file: ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/f/f8c57dce07c09940c1bde67fe02d171a432edf07.png)For “Reason\_ar” slot I need to collect input from 5 pre defined options but if uses selects “other” as a reason, in that case only i want to collect open ended text message from uses. Any idea how this will be done ?

---

<div class="post-metadata">

**Author:** ![Gehova](https://avatars.discourse-cdn.com/v4/letter/g/2acd7d/32.png) [@Gehova](https://forum.rasa.com/u/Gehova)\
**Post date:** [September 23, 2019, 6:53pm UTC](https://forum.rasa.com/t/how-to-get-input-from-user-in-the-middle-of-formaction/17112/2 "2019-09-23T18:53:55Z")

</div>

Check Justina [tutorial on forms](https://blog.rasa.com/building-contextual-assistants-with-rasa-formaction/?_ga=2.60731246.212028585.1569243725-1349818766.1563821081). You’ll need to add some custom logic like in the example:

```auto
def required_slots(tracker):
    # type: () -> List[Text]
    """A list of required slots that the form has to fill"""

    if tracker.get_slot('Reason_ar') == 'other':
        return ["FromDate_ar", "ToDAte_Ar", "FromTime", "ToTime", "Reason_ar", "OtherReason"]
    else:
        return ["FromDate_ar", "ToDAte_Ar", "FromTime", "ToTime", "Reason_ar"]

```

For the open ended text message, you need to add this in your slot\_mappings:

`"OtherReason": self.from_text(intent=None)`

---

<div class="post-metadata">

**Author:** ![kpreetsid](https://avatars.discourse-cdn.com/v4/letter/k/779978/32.png) [@kpreetsid](https://forum.rasa.com/u/kpreetsid)\
**Post date:** [September 24, 2019, 5:25am UTC](https://forum.rasa.com/t/how-to-get-input-from-user-in-the-middle-of-formaction/17112/3 "2019-09-24T05:25:05Z")

</div>

Thanks for reply, will implement this and get back if something comes up. 😃
