How to identify a column in monday.api

what is the best way to identify that a column is of type “Location” on a board using monday.api?

to create a view, and to identify the location column from the board being called. regardless of the name given by the user.

Thank you. any help is useful.

Hello @isrraelRios ,
You can do that by querying for the column type. The Location column has a type of location.
Here is an example:

{
  boards(ids: 12345) {
    columns {
      type
    }
  }
}
1 Like

hello @kolaai, thank you for your reply. however, I was wrong to ask the question. it should be : how do I get the contents of a column of type location (get all the cities in the column). If I use “column(ids:“location”){}” it might not work as that Ids may vary on different boards.

To do that, you will have to query all the different boards and the location column ids in them. Then you can make final query with the board ids and the location column ids. The final query will look something like this:

{
  boards(ids: [1234, 5678]) {
    items  {
      column_values(ids: ["columnIdFromBoard1", "columnIdFromBoard2"]) {
        text
        value
      }
    }
  }
}
1 Like

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