Items by Column Value for blank fields

I am trying to programmatically query via items_by_column_values for fields with blank values (passing “” as the value). I have tried to query for blank on the following field types: Person, Timeline, Number, and they all return no results although there are many responses:

“data”: {
“items_by_column_values”:
},

Is querying for blank fields supported?

Hi @avp,

While it’s not possible to query for blank values, there are other queries that can help you get this information.

For example, you could use the Items query to query for column values, and the response of this call will include the null values:

query {
  boards (ids:1234567) {
    items {
      id
      column_values (ids: "text") {
        value
      }
    }
  }
}

Here’s an example of what the response could look like:

{
  "data": {
    "boards": [
      {
        "items": [
          {
            "id": "3334510076",
            "column_values": [
              {
                "value": "\"Buy\""
              }
            ]
          },
          {
            "id": "2674964569",
            "column_values": [
              {
                "value": null
              }
            ]
          }
        ]
      }
    ]
  }
}

I hope this helps! Please let me know if you have any more questions.

Thanks for the response! Unfortunately this is not really a viable option for us. The board in question contains thousands of items and getting all that information back from the Monday API takes quite a long time.

For an example of scale, we’re talking something like 10 blank fields per 2000 items, and running this check periodically. It would be greatly advantageous for this and other scenarios to be able to request only items with column X is “”. Is there any intention to support this in future?

If time is your concern, you can retrieve the data in parts (instead of getting all columns or all items).

The trick is to filter on items AND on column values in each call, and run them in parallel. Example queries below.

By the way, a note on API calls in parallel: you cannot make multiple updates to your data at the same time, but simple reads like this are relatively safe.

Query 1:

query {
This text will be hidden  boards (ids:1234567) {
    items (limit:100, page:1) {
      id
      column_values (ids: "text") {
        value
      }
    }
  }
}

Query 2+:

query {
  boards (ids:1234567) {
    items (limit:100, page:2) {
      id
      column_values (ids: "text") {
        value
      }
    }
  }
}