Version: Latest

User Satisfaction Survey

This guide shows you how you can create a survey flow to collect a user's feedback about their conversation experience. You achieve this by using a link step at the end of your flow instead of an END step.

note

This solution depends on features only available in Rasa Pro v3.9 and later.

Adding the survey flow

First, create a survey flow with a flow guard that always evaluates to false. This ensures that our flow this flow can only be started from within another active flow.

feedback.yml
flows:
collect_feedback:
description: Collect user satisfaction feedback
if: False
steps:
- collect: user_satisfaction

Add the corresponding slot and utterance to your domain:

domain.yml
slots:
user_satisfaction:
type: float
responses:
utter_ask_user_satisfaction:
- text: |
On a scale from 1 (not at all satisfied) to 5 (completely satisfied),
how satisfied are you with this conversation?
buttons:
- payload: "/SetSlots(user_satisfaction=1)"
title: "1 (not satisfied)"
- payload: "/SetSlots(user_satisfaction=2)"
title: "2 (somewhat unsatisfied)"
- payload: "/SetSlots(user_satisfaction=3)"
title: "3 (neutral)"
- payload: "/SetSlots(user_satisfaction=4)"
title: "4 (somewhat satisfied)"
- payload: "/SetSlots(user_satisfaction=5)"
title: "5 (very satisfied)"

Finally, add the link step to start the survey flow. In this example, we start with the CALM template bot and add the link to the list your contacts flow:

list_contacts.yml
flows:
list_contacts:
name: list your contacts
description: show your contact list
steps:
- action: list_contacts
next:
- if: "slots.contacts_list"
then:
- action: utter_list_contacts
- link: collect_feedback
- else:
- action: utter_no_contacts
- link: collect_feedback

Train your bot and start it with rasa inspect. Send the message "list my contacts" to the bot to trigger the response.

Screen shot of Rasa inspector showing user satisfaction survey