RASA X change slots order in form

Hi, I wanted to ask if there is a reason for alphabetical order of slots used by forms (defined in domain file) when using RASA X?

I have something like this in my domain file:

 personal_data_form:
    name_and_surname:
      - entity: persName
        type: from_entity
    date_of_birth:
      - entity: time
        type: from_entity

When I start RASA X on my server, it edits my domain file and introduce an alphabetical order to my slots. Like this:

personal_data_form:
    date_of_birth:
      - entity: time
        type: from_entity
    name_and_surname:
      - entity: persName
        type: from_entity

Is that a desired behavior? I want my form to ask for name first (and then for date of birth). Rasa shell works just fine, but RASA X breaks the order of my slots and the dialog is incoherent.

Thanks in advance for response/advice.

@BarMin, you can use custom action to ask for the next action, i’ll send you the docs of teaching how you should do. Hope it helps :smiley:

1 Like

AFAIK, this is a bug in the current version of Rasa X and a tracked issue. It should be fixed in a release soon. In the meantime, you can use the custom action workaround in the comment above.

2 Likes

Thanks for the answers. I actually just add numbers to my slots like:

    1_name_and_surname:
      - entity: persName
        type: from_entity
    2_date_of_birth:
      - entity: time
        type: from_entity

It’s not very beautiful, but it works both in RASA X and RASA and I didn’t have to create any custom actions this way (less code is always better :D)

When this bug will be fixed i will just remove the indices and that’s it.

2 Likes

Hey!

I like the discussion going on here. Been running into a similar use-case where I want my form to run in a certain order. So I take it, @BarMin that your users are always asked to fill a requested slot in the order you set up there? Also, that’s a great hacky fix :smiley:

@kearnsw, has this bug been resolved in the latest release yet?

Yes. That’s correct. Numbers are actually necessary only if you use RASA X, because it sorts the slots by name and save it back to domain.yml (very annoying bug). RASA X is not open-source, so… There is no way to fix it properly on your own.

If you use RASA service only - then it works just fine (because RASA doesn’t sort anything) and the order of slots is preserved just fine and no numbering is needed.

1 Like