Custom output payload

Hi, I have tried the instruction about datetime custom payload from this link, the format of custom payload is:

utter_ql:
  - custom:
      blocks:
      - type: section
        text: 
          text: 'Can you tell me the start date and end date?'
          type: mrkdwn
        accessory:
          type: datepicker
          initial_date: '2019-05-21'
          placeholder:
            type: plain_text
            text: Select a date

From Slack api, i think the above markdown text is similar with the below json format.

{
  "type": "section",
  "text": {
    "type": "mrkdwn",
    "text": "Can you tell me the start date and end date?"
  },
  "accessory": {
    "type": "datepicker",
    "action_id": "datepicker123",
    "initial_date": "2019-05-21",
    "placeholder": {
      "type": "plain_text",
      "text": "Select a date"
    }
  }
}

So, my question is : Can I convert the following json text into markdown so that i can create the static_select in Slack from Rasa.

{
    "blocks": [
        {
            "type": "section",
            "text": {
                "type": "mrkdwn",
                "text": "Pick the hour for the deadline"
            },
            "accessory": {
                "type": "static_select",
                "placeholder": {
                    "type": "plain_text",
                    "text": "Select an item",
                    "emoji": true
                },
                "options": [
                    {
                        "text": {
                            "type": "plain_text",
                            "text": "10",
                            "emoji": false
                        },
                        "value": "10"
                    },
                    {
                        "text": {
                            "type": "plain_text",
                            "text": "11",
                            "emoji": false
                        },
                        "value": "11"
                    },
                    {
                        "text": {
                            "type": "plain_text",
                            "text": "12",
                            "emoji": false
                        },
                        "value": "12"
                    },
                    {
                        "text": {
                            "type": "plain_text",
                            "text": "13",
                            "emoji": false
                        },
                        "value": "13"
                    },
                    {
                        "text": {
                            "type": "plain_text",
                            "text": "14",
                            "emoji": false
                        },
                        "value": "14"
                    }
                ]
            }
        }
    ]
}

You should be able to! Have you confirmed that if you send the above JSON, it works?

Anything that works in slack should be outputtable with custom payloads. As for input, all of the supported input payloads are listed here, and static select is one of them.

It’s actually not markdown it’s yaml. you can convert it here: https://www.json2yaml.com/

1 Like

Thank you for the answer. I solved my problem.