Query returns null for Formula Field

Hey all,

I’ve read in the documents that we are able to pull from formula fields. When I try to pull them, they are coming back as null and an empty string. Looking at the column on the board, it should be coming back as “100%”. This is a long calculation that will take a bit of time to calculate in C#. Is there something I’m doing wrong?

query:
query {boards (ids: BoardID){items (page:1, limit: 250) {name id column_values(ids:“formula3”){id value text}}}}

Returns:
“column_values”: [
{
“id”: “formula3”,
“value”: null,
“text”: “”
}
]

Reading the formula column
You can query the formula column using the column_values object. 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.

1 Like

Hi @Meneghini

Long time since we see you here so welcome back. :slight_smile:

Someone from the community or the tech team will answer your question soon.

Until it happens, thank you for using this platform to ask and have a wonderful week.

Hello there @Meneghini,

The result of a formula column can not be retrieved via API since it is calculated on the client side.

You can get the structure of the formula if you use a query like this one:

{
  boards(ids: 123456789) {
    columns(ids: "formula") {
      settings_str
    }
  }
}

Please let me know if you have any questions!

Cheers,
Matias

1 Like

Hey, thank you for the update. I’m just a bit confused on what this section of the API documentation means. Am I reading it wrong? Why allow us to read it under column_values if it will always return nothing?

Reading the formula column
You can query the formula column using the column_values object. 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 .

Hello again,

You can query for information like the ID or the type.

Since you can query for information (even if you can not get the result of the formula), you can still read it under column_values since column_values does not only contain the result or text of the column.

Let me know if you have any other questions!

Cheers,
Matias

1 Like