How do I make bot to just accept data in a flow without doing anything

Hi All,

I am trying to accept following data from user:

  1. name
  2. email id
  3. mobile number

So what I want is to just accept this data just like normal application without doing anything. just wanna grab data it can be anything. So is there any way to achieve this.

Because I have used forms and inside form flow it don’t go to another flow even if we enter data of another intent that is outside form flow that is perfectly fine. But in form when I give any random data it show me default action instead of that it should grab that data in that particular slot so that I can validate it further in forms validate methods.

forms have from_text slot mapping (see Forms for details) that grabs any input and put it into requested slot

Hi @Ghostvv,

Can you please elaborate on the same. Please…

Hi @prashant_kamble,

You can use from_text to extract any type of input given by the user. Inside your form you could do something like this:

def slot_mappings(self):
        # type: () -> Dict[Text: Union[Dict, List[Dict]]]
        """A dictionary to map required slots to
            - an extracted entity
            - intent: value pairs
            - a whole message
            or a list of them, where a first match will be picked"""

        return { "name": [self.from_text()] } 

This way your slot will be filled with any string given by the user.

1 Like

Thank you so much @BrunoRoth95 and @Ghostvv,

It’s working :slightly_smiling_face::slightly_smiling_face:

Hi @BrunoRoth95, @Ghostvv,

Is there any way that I can extract entity as well from user message. Currently what is happening is:

If user types anything, bot is setting slot accordingly with whole string.

But what if user giving his name like “my name is alex”. So it should be able to extract “alex” only but now it’s getting whole message inside slot i.e “my name is alex”. So how do I achieve this???

there are other slot mappings for it. Please take a look at our tutorial: Building contextual assistants with Rasa Forms