Unable select buttons inside buttons

I’ve wrote custom action to load the buttons inside buttons but unable to select the buttons from custom action. What is the better approach to load buttons inside buttons and how to handle requests with selection?

from typing import Any, Text, Dict, List

from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher

class Hairloss(Action):
    """docstring for Hairloss"""

    def name(self):
      """name of the custom action"""
      return "action_hair_loss_details"
    
    def run(self,dispatcher,tracker,domain):
          dispatcher.utter_message(buttons = [
                {"payload": "utter_hair_loss1", "title": "Hair loss 1"},
                {"payload": "utter_hair_loss2", "title": "Hair loss 2"},
                {"payload": "utter_hair_loss3", "title": "Hair loss 3"},
                {"payload": "utter_hair_loss4", "title": "Hair loss 4"},
            ])
          return []

nlu.yml

- intent: bot_suggestions_1
  examples: |
    - Hair Loss
    - About Us
    - Treatments
    - Clinics
    - results
    - Our Products
    - Blog
    - FAQs

domain.yml

actions:
- utter_greet
- utter_menu
- action_hair_loss_details
responses:
  utter_greet:
  - text: Hey! How are you?
  utter_menu:
  - buttons:
    - payload: /utter_hair_loss
      title: Hair Loss
    - payload: /bot_suggestions_1
      title: Scalp restorations
    - payload: /bot_suggestions_1
      title: Scalp Analysis
    - payload: /bot_suggestions_1
      title: Dandruff removal
    text: What are you looking for today?

stories.yml

- story: happy path2
  steps:
  - intent: greet
  - action: utter_greet
  - intent: mood_great
  - action: utter_happy
  - action: utter_menu
  - intent: bot_suggestions_1
  - action: action_hair_loss_details
  - action: utter_did_that_help

Result:

add / to the payload in custom actions for the button to be detected.

from

to this

It is also better to send the text for the buttons from the custom actions itself, instead of calling just the text from domain and buttons from custom actions

Thanks for the help and Sorry didn’t get the latter part?

Can you please show if any example?

Also i’ve made the changes according to your comments but it doesn’t let me select the buttons which loaded later. Attaching screenshot:

@bharath-madduri I’m still seeing the same issue after adding the / to payload as per your comments. Kindly can you please see if there is something is missing?

forgot to notice, in the payload you have to give the intent, not the utterance. in stories you have to define which intent should reply the utterance. I might have misunderstood your query, you can not load a button inside a payload, it should be an intent and there should be a story defined for the intent. If you can notice the warning, clearly mentioned it is expecting an intent for the payload.