Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slack blocks nested bullet point list

I need to send a API request to slack with a message containing a nested bullet point list. I've found the following answer to a existing question: https://stackoverflow.com/a/68483110/16659015 but sadly this only shows a normal bullet point list without nesting.

I couldn't find any resources or documentation to this rich_text and rich_text_list types and when trying different orders the block kit builder threw errors.

How can I utilize the blocks with rich_text to create a nested bullet point list?

(I know there are workarounds but if a 1 dimensional bulletpoint exists through blocks then a nested should also be possible somehow)

like image 695
Tamino Avatar asked Jan 18 '26 07:01

Tamino


1 Answers

For anyone else like me looking for this in the future here is the solution:

You can see it documented here: https://api.slack.com/tutorials/tracks/rich-text-tutorial

You can see a demo in the block builder here.

And here is the example code copied from the docs. The trick is simply to make a separate list block below your current one and use the indent property:

{
"type": "rich_text",
"elements": [
    {
        "type": "rich_text_section",
        "elements": [
            {
                "type": "emoji",
                "name": "office"
            },
            {
                "type": "text",
                "text": " Company business",
                "style": {
                    "bold": true
                }
            }
        ]
    },
    {
        "type": "rich_text_list",
        "style": "bullet",
        "elements": [
            {
                "type": "rich_text_section",
                "elements": [
                    {
                        "type": "text",
                        "text": "Fill out your W-2"
                    }
                ]
            },
            {
                "type": "rich_text_section",
                "elements": [
                    {
                        "type": "text",
                        "text": "Enroll in "
                    },
                    {
                        "type": "link",
                        "text": "benefits",
                        "url": "https://salesforcebenefits.com"
                    }
                ]
            },
            {
                "type": "rich_text_section",
                "elements": [
                    {
                        "type": "text",
                        "text": "Fill out your Slack profile, including:"
                    }
                ]
            }
        ]
    },
    {
        "type": "rich_text_list",
        "style": "ordered",
        "indent": 1,
        "elements": [
            {
                "type": "rich_text_section",
                "elements": [
                    {
                        "type": "text",
                        "text": "Time zone"
                    }
                ]
            },
            {
                "type": "rich_text_section",
                "elements": [
                    {
                        "type": "text",
                        "text": "Pronouns"
                    }
                ]
            }
        ]
    }
]

},

like image 112
Emil Avatar answered Jan 21 '26 08:01

Emil



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!