Querying for additional custom columns in an items page

I’m needing to know what the method is to retrieve additional non-stock columns from an items page query.

I have a text field that is storing an item id from a different system and need to include that column in the select, but whatever I’ve tried does not work and the API reference does not speak to it other than this…

I can run my query and it will return results fine with just the id and name columns as items…but the moment I add anything else, I can’t get any responses, just errors that my response variable is null.

Here’s my query:

query {
boards (ids: our_board_id){
items_page (limit: 1, query_params: {rules: [{column_id: “text__1”, compare_value: [“’ . $accountid . '”]}], operator: and}) {
cursor
items {
id
name
}
}
}
}

Like I said, that query will return items fine, but this situation is problematic as my source system is allowing item ids that may be the same strings but with a slight variation - for example, one item id might be 000011201OlJ and the second is 000011201Olj …so as far as letters the same but with case not at all and thus are unique.

When I query with say the first value…if I set the limit to 1 to sample for an EXACT match…I can’t get one. It returns as if it’s doing a “like” or case insensitive query.

So…my workaround was to just pull the source system item id from the account structure, then do a compare in my code. It’s more work than we should have to do, but if it fixes it, I can make it work.

Any ideas/suggestions on how to get an additional custom column returned in the items? The custom column api name is text__1.

Thanks in advance.

Hello there @netadmin_cf8594845,

As you mentioned, the query is not case sensitive.

I believe your workaround is the way to go here (getting the value of the IDs and comparing them with your database) :smile:

Cheers,
Matias

@Matias.Monday

I just ended up dumping the account structure from Monday to an excel file and converted it to a csv. Trimmed it down to the columns I needed and am running the new import as I type this. It’s working perfectly as far as I can see so far, but will know far more after it’s done. We’ve got quite a few contacts to import, so it’s going to be chewing on that for a little minute… :slight_smile:

I still would like to know how I can return other columns in the items part of the fields in an items page, though (like I asked first - in other words, how can I return not only id and name, but also my custom column with id text__1).

Thanks again!

Hi @netadmin_cf8594845 !

To get the column values of any column (such as your text column), you can just get the column values from the items in the board like this (documentation here):

{
  boards(ids: [1234567890]) {
    items_page(limit: 500) {
      cursor
      items {
        column_values {
          text
          value
        }
      }
    }
  }
}

Take into account that some column types will require specific syntax. You can find the documentation about each column type here and examples here.

If you want to get only the values of specific columns, you can run something like this:

{
  boards(ids: [1234567890]) {
    items_page(limit: 500) {
      cursor
      items {
        column_values(ids: ["text__1", "status"]) {
          text
          value
        }
      }
    }
  }
}

Perfect.

That’s exactly what I was looking for.

I’ll give that a try.

That will hopefully let me finish up this integration and get it in motion.

Thanks, Matias!

Happy to help @netadmin_cf8594845 !!