Finding column data using Column names and IDs

Hello,

I’m trying to figure out how to properly query board data. Specifically column values.

Is there another way to specify what columns you want to limit your query to? All I see currently is IDs…and those seem be very interesting in the return. I’m getting weird responses back (i.e. Text7, number45, timeline_1, timeline, dup__of_resource_name, etc.). These aren’t the same in each board I’m querying, even though the titles of the columns are very consistent. So while my boards “look” the same, I can’t filter/query them consistently to get the data I need to the above. If I could query by title (which seems that those could be made consistent) it would really help…

Any ideas on how to modify this? Is there a way to do this? Am I missing something?

as an example, see below:

“items”: [
{
“id”: “1311669384”,
“name”: “Bids and Proposals Support”,
“column_values”: [
{
“id”: “text5”,
“title”: “Task ID”
},
{
“id”: “status_14”,
“title”: “Task Assignment”
},
{
“id”: “numbers45”,
“title”: “Planned effort”
},
{
“id”: “dup__of_resource_name7”,
“title”: “Resource Name”
},
{
“id”: “status”,
“title”: “Status”
},
{
“id”: “text6”,
“title”: “Project Code”
}

This is a snippet of the ID and title of a board. I have a board that has the same column titles, but the corresponding IDs are completely different.

The problem I have is that I don’t need all the columns from my return. I really just need like 4 columns. But I have to return ALL columns which is a huge complexity cost and it’s causing my queries to timeout in my code (running this in the website query engine takes a minute to return all the columns).

Hi @BeauElliott

I’d need to see an example of the query you are running to try and understand, however I currently do things such as parsing the data returned from the time tracking column with a query as:

query {
  boards (ids: [99999999]) {
    items {
      column_values (ids: [time_tracking] ) {
        id
        value
      }
    }
  }
}

This returns the column data similar to:

{
  "column_values": [
  {
            "id": "time_tracking",
            "value": "REDACTED"
          }
        ]
      },
      {
        "column_values": [
          {
            "id": "time_tracking",
            "value": "REDACTED"
          }
        ]
      },

and so on.

Is this the sort of thing you need?

I can do the above, but what I’m seeing is that the IDs in the boards are not consistent. When a user updates/adds a column to a board, they can update the actual Title of the board. But the ID is very different and seems to vary in naming (i.e. “Text7”, “number47”, Dup_resource_name7", etc.). However looking at the two boards (or more) on the Monday.com website “look” to be identical. So trying to write code to query and parse similar data on similar boards is next to difficult.

since you can filter your query by ids in the column values, I was hoping there was a way to filter by title as well. It seems as users we have more control on the title than we do the IDs internally.

Hi @BeauElliott,

You need to first query all columns (id, title, type) from each board.

Then you match the Column titles you seek with their ids (for each board).

Personally on this step I also check the column type and the title+type uniqueness.
(Note that mirrored columns get the type lookup whatever their original type was)

Then you can query column_values based on selected column ids.

It would be nice to get it in one go with a new query, but it does not seem to exist (yet :wink:).

1 Like

Hi @BeauElliott!

In addition to these wonderful community members’ suggestions, I would also like to ask some more questions about your process.

It sounds like what you’re trying to do, is to query only certain column type data (i.e. status, text, etc) across all of your boards, right?

If so, you are indeed correct that column IDs will differ across boards (they are board specific though, so it’s possible that two boards will have the same column ID).

As such, I think you would not be able to get around querying all of the columns on a board. However, like @LaurentConroux suggested, instead of querying column_values right away you can always start by querying columns and their id to first search for these specific column types.

After locating these column types, you can then go about querying their column_values!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.