User Response Tracking in actions

want to get access to the payload values from my custom buttons. The main idea is to choose one option from the buttons, and then collect the payload values in a variable, in order to pass these to the next action.

The custom buttons are in a loop where from each items I collect the needed values for the “titles” and for the “payloads”. I want to achieve this in a dynamic way, since I have a lot of different variables with different length.

Here is my code until now:

def run(self, dispatcher: CollectingDispatcher,
         tracker: Tracker, domain: Dict[Text, Any],
     ) -> Text:
   for element in request.question.items:
   for l in element['choices']:
   buttons.append({"title": "{}".format(l['label']), "payload": "{}{}".format(element['id'],l['id'])})

   return [] 
dispatcher.utter_button_message(message, buttons)

Again, my question is how to access the selected payload values. In rasa x I can see that the payload is being selected properly, for example: “11,true”.

But I find no way to get these values into another variable. I also tried tracker.latest_message.get(‘text’) , but I only get the last user input.

Is there a similar function to “tracker.latest_message.get” for the last chosen button option or last utterance from bot?

Any help will be appreciated.


def validate_vCode(
        value: Text,
        dispatcher: CollectingDispatcher,
        tracker: Tracker,
        domain: Dict[Text, Any],
) -> Dict[Text, Any]:
    """Validate cuisine value."""
    value=re.findall('\d+', str(tracker.get_slot('vCode')))
    if value:
        if value in vList:
            # validation succeeded, set the value of the "cuisine" slot to value
            return {"vCode": value}
            return {"vCode": None}

when I submitting the form , the set slots are not populating. all are going to be None after filling the 2nd requested slot value.

Hi @Edukondalu, To your first question - the payload should be coming in as a user message; which version of rasa/rasa-sdk are you on? utter_button_message will be deprecated at some point (you should get a warning in a newer version) that’s why I’m checking. If you run rasa shell, what do your buttons look like when you reach that point in the convo? You should be able to see what payload it’s going to send back.

when I submit my buttons and entities are text then it is working fine.

am planing stop the form but again anything text value it is not stopping the story. so how can stop the story


  • greet
    • utter_greet
  • vendorProfile -vendor_profile_form
    • form{“name”: “vendor_profile_form”}
  • deny
    • utter_ask_continue
  • affirm
    • vendor_profile_form
    • form{“name”: null}
    • utter_slots_values
  • thankyou
    • utter_noworries

you’re missing action_vendor_profile_form to start the form flow. I’m not quite clear on the question you’re asking though?