Hi there, I 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.
Any help will be appreciated.
Thanks