Skip to main content

Data table block

The data table block is a rich table that supports pagination, sorting, filtering, and rich interactivity, such as opening a Work Object flexpane or clickable links in cells. This is different from the existing table block, which only supports filtering and basic interactivity.

Fields

FieldTypeDescriptionRequired?
typeStringThe type of block. For a data table block, type is always data_table.Required
rowsArrayAn array consisting of table rows.Required
block_idStringA unique identifier for a block. If not specified, a block_id will be generated.Optional
page_sizeIntegerNumber of rows per page. Min 1, Max 100. Defaults to 5 if omitted.Optional
captionStringA caption for the table; used as the value for the HTML caption element.Required
row_header_column_indexIntegerThe 0-based index of the column that uniquely identifies each row (the row header). This column is treated as the row's primary identifier for screen readers. Defaults to 0 if omitted.Optional

Usage info

You can use rich_text, raw_text (simple text), or raw_number (numeric values) for cell content. The first row of the table is a header, and rich_text cannot be used for header cells. You can have a minimum of 2 rows (1 regular row plus the header) and a maximum of 101 rows (100 regular rows plus the header). All rows must have the same number of values.

A single table's character count across all cells cannot exceed 10,000 characters. Additionally, the aggregate character count across all table cells for a single message cannot exceed 10,000 characters. Large tables should be broken up into separate messages.

Sorting rows by column is done alphabetically by default. If a column contains cells all of type raw_number, a numeric sort will be performed instead. You can have a minimum of 1 column and a maximum of 20 columns.

Schema for raw_text

"properties": {
"type": {
"type": "string",
"enum": ["raw_text"]
},
"text": {
"type": "string",
"minLength": 1
}
}

Schema for raw_number

"properties": {
"type": {
"type": "string",
"enum": ["raw_number"]
},
"value": {
"type": "number"
},
"text": {
"type": "string",
"minLength": 1
}
}

Example

A sample data table block:

{
"blocks": [
{
"type": "data_table",
"caption": "A Fabulous Table",
"rows": [
[
{
"type": "raw_text",
"text": "Name"
},
{
"type": "raw_text",
"text": "Department"
},
{
"type": "raw_text",
"text": "Badge"
}
],
[
{
"type": "raw_text",
"text": "Data Refinement Department"
},
{
"type": "raw_text",
"text": "MDR"
},
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "Blue",
"style": {
"bold": true
}
}
]
}
]
}
],
[
{
"type": "raw_text",
"text": "Art Sourcing Department"
},
{
"type": "raw_text",
"text": "O&D"
},
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "Green"
},
{
"type": "text",
"text": "review",
"style": {
"italic": true
}
}
]
}
]
}
],
[
{
"type": "raw_text",
"text": "Wellness Department"
},
{
"type": "raw_text",
"text": "Wellness Center"
},
{
"type": "rich_text",
"elements": [
{
"type": "rich_text_section",
"elements": [
{
"type": "text",
"text": "Limited",
"style": {
"bold": true
}
}
]
}
]
}
]
]
}
]
}

View in Block Kit Builder