question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uttering a message while Form Filling

See original GitHub issue

I want to utter an output message depending on the last form slot that is filled, and then continue filling the form slots once the message is uttered to the user.

I tried using dispatcher.utter_message() but the message only pops up once all the form slots are filled. Is there a solution to this?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
lahsukcommented, Jul 24, 2019

Hi @sonakshisaxena1 ,

Are you using dispatcher.utter_message() in run? If so, it’ll only appear once all form slots are filled. This is not a bug.

If you want the message to appear as slots get filled, you can do that by putting dispatcher.utter_message() inside the validate_{slot} method. e.g> If you have a slot of type user then you can do it like:

def validate_user(self,
    value: Text,
    dispatcher: CollectingDispatcher,
    Tracker,
    Dict[Text, 
) -> Optional[Text]:
    if value not in predefined_user_types:
        dispatcher.utter_message("Please select a valid user type.")
        return {"user": None}
    else:
        # custom message goes here
        dispatcher.utter_message("User is of correct type.")
        return {"user": value}

Hope that helps. 😄

P.S: You can read more about using forms here: https://blog.rasa.com/building-contextual-assistants-with-rasa-formaction/

1reaction
sonakshisaxena1commented, Jul 25, 2019

Yes @federicotdn. Thankyou @lahsuk 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uttering a message while Form Filling - Rasa Community Forum
Hello, I want to send a “Searching…” before the api call on submit. I read about a solution that was calling the dispatcher.utter_message() ......
Read more >
6 Form Error Message Mistakes Almost Everyone Makes
Let's review six common mistakes you'll want to avoid while creating error messages for your web forms and six preferable examples you can ......
Read more >
Form Success Message: Best Practices and Examples
The form success message is a must for any web form. Discover with examples taken from the web the best practices to fine...
Read more >
Form Validation: Why It Matters and How to Get It Right - CXL
If they have to start from scratch, it causes frustration and they might not do it.
Read more >
custom message still showing after form input is filled
There were two issues in your JavaScript that were causing your validation to break: The validateForm function was running on page load, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found