Formula
The formula column calculates anything from simple mathematic equations to complex formulas. Our API partially supports the formula column, so you can only read it via the API.
Reading the formula column
You can query the formula column using the column_values
object. Reading the calculated formula values is not supported but you can query metadata about the column.
The object has different fields based on which API version you are using. Column values v2 fields will be available in API versions 2023-10
and later, while column values v1 fields are only supported in versions 2023-07
and 2023-04
.
Column values v2
The column_values
object enables you to return column-specific subfields by sending a fragment in your query. Values for the formula column are of the FormulaValue
type.
Pro tip
column_values
v2 fields are only available in API version2023-10
.
query {
items (ids:[1234567890, 9876543210]) {
column_values {
... on FormulaValue {
value
id
}
}
}
}
Fields
Field | Description |
---|---|
column Column! | The column the value belongs to. |
id ID! | The column's unique identifier. |
text String | Reading calculated values is not supported, so this field will return null . |
type ColumnType! | The column's type. |
value JSON | Reading calculated values is not supported, so this field will return null . |
Workaround to read a column's formula
While the FormulaValue
implementation doesn't allow you to read the formula in the column or its calculated values, you can query the column's settings_str
to return the formula itself as JSON.
Sample query
query {
boards (ids:1234567890) {
columns (ids: "formula") {
settings_str
}
}
}
Sample response
{
"data": {
"boards": [
{
"columns": [
{
"settings_str": "{\"formula\":\"ADD_DAYS({date_1},15) \"}"
}
]
}
]
},
"account_id": 12345678
}
Join our developer community!
We've created a community specifically for our devs where you can search through previous topics to find solutions, ask new questions, hear about new features and updates, and learn tips and tricks from other devs. Come join in on the fun! 😎
Updated about 1 month ago