Issue with storing user input in the slot through rasa forms


I have a form where “Address” is taken as input from the user. Randomly when user inputs the “Address”, value entered gets stored as list of multiple elements instead as a single string.

For ex: if the user enter address as

67-52 6th cross 2nd main Bangalore - 560085 India

value gets stored as list shown below

[“67-52”, “6th cross 2nd main”, “67-52 6th cross 2nd main Bangalore”, “67-52 6th cross 2nd main Bangalore - 560085 India”]

In domain.yml, address slot is given as below

    auto_fill: false
    type: text

In NLU, following examples are being given for training


- my address is [#35/82, 2nd cross, Bangalore](address)
- [67-52 6th cross 2nd main Bangalore - 560085 India](address) is my address.
- [676 4th Phase 2nd main South Africa](address)
- [Cape of Town](address)
- I work in [Bangalore 60](address)
- [India Karnataka](address)
- my address is [India Delhi](address)
- [Jayanagar Bangalore](address)
- place is [Mumbai India](address)
- i was born in  [Kolkatta](address)
- [India](address)
- I am from [Nigeria](address)
- i stay in [Egypt](address)
- i permanent address is in [Andhra Pradesh](address)
- My native is [Tamil Nadu](address)
- i stay in [Kerala](address)
- [7878, 6th main road, 4th cross, Jayanagar Kolkatta India](address) 

How to figure out when user input is stored as list and when user input is stored as string?

Hi @rakshitha. This is a bit weird. Of the slot is being filled using a form, you should set the type of your slot as unfeaturized and allow the slot to be filled from the extracted entities (remove the auto_fill flag).

I think the reason why your slot is filled as a list has something to do with the things I mentioned above and there might be some things that are happening in your form implementation. Do you do custom slot mappings for the address slot?

Hi @Juste,

Thank you for your quick response. I am using the following mappings for the slot in actions

def slot_mappings(self) -> Dict[Text, Union[Dict, List[Dict]]]:

    return {
        "email_id": [self.from_entity(entity="email", intent="give_mail"), self.from_text()],
        "address_slot": [self.from_entity(entity="address", intent="give_address"), self.from_text()],

Do I need to change anything in the above mentioned mappings?

The mappings seem to be implemented well. Have you tried to implement my suggestions above? Changing the slot types to unfeaturized and allowing the autofill?

Hi @Juste,

Thank you for the solution. It solved our issue.

On a different note, we are trying to run rasa-demo bot, Sara. We tried to test the contact sales feature of the bot and run into a issue where business email id is not been accepted by the bot. Error is as follows :

Failed to write data to gdocs. Error: {}" “”.format(e.message), AttributeError: ‘JSONDecodeError’ object has no attribute ‘message’

We have installed all the packages mentioned in the requirements.txt and also running the duckling server. Can you help us in fixing this issue?