Skip to main content

How to get text value from mirror column via api

  • January 12, 2024
  • 7 replies
  • 507 views

Dear Sirs,

please advise i’m try get value from my board & group but have some trouble.

  1. can we filter or give column value condition such as grater than 2000 and less than 3500. what topic which we can read

  2. when i’m get response from api - version 2023-10 seem i cannot found text value from mirror column. How to get them if they are more than one column value

this is my syntax

query {
  boards(ids: [18084084XX]) {
    groups(ids: ["new_group269XX"]) {
      title
      items_page {
        items {
          id
          column_values {
            id
            text
            column {
              title
            }
            ... on BoardRelationValue {
              linked_items {
                id
                name
              }
            }
            ... on MirrorValue {
              text
              column {
                id
                title  
              }
              id
            }
          }
        }
      }
    }
  }
}

7 replies

basdebruin
  • Community Expert
  • January 12, 2024

When using the … on MirrorValue fragment the property you are looking for is called display_text not just text. This is also the case for other fragments.


  • Author
  • New Participant
  • January 12, 2024

Thank you very much
.
Do you meant change

… on MirrorValue {
display_text
column {
id
title
}

And how about the first question if I set condition in column value


basdebruin
  • Community Expert
  • January 12, 2024

Actually it is display_value, not display_text, sorry for the confusion. As for the conditions, see Other types and the specifics for filtering a number column here Numbers

The total query looks like this:

query {
  boards(ids: [18084084XX]) {
    groups (ids: ["new_group269XX"]){
      title
      items_page (query_params: {rules: [{column_id: "numbers", compare_value: [2500], operator:greater_than}, {column_id: "numbers", compare_value: [3000], operator:lower_than}]}){
        items {
          id
          column_values {
            id
            text
            column {
              title
            }
            ... on BoardRelationValue {
              linked_items {
                id
                name
              }
            }
            ... on MirrorValue {
              display_value
              column {
                id
                title  
              }
              id
            }
          }
        }
      }
    }
  }
}

I recommend to play around in the API Playground. It is designed to play around 🙂


  • Author
  • New Participant
  • January 16, 2024

Thank you very much

query {
  boards(ids: [18084084xx]) {
    groups(ids: ["new_group269xx"]) {
      title
      items_page (query_params: {rules: [{column_id: "property_id", compare_value: ["26d090f1-8ad6-Ac35-8a62-fc9e38b81ec5","9853c253-1b2c-Ada7-97f4-33b7d6f7a14c","19768d04-b806-Abf3-b7cc-ec43722e1a48"]}]}) 
      {
        items {
          id
          column_values {
            id
            text
            column {
              title
            }
            ... on BoardRelationValue {
              linked_items {
                id
                name
              }
            }
            ... on MirrorValue {
              display_value
              column {
                id
                title  
              }
              id
            }
          }
        }
      }
    }
  }
}

and get proper items already
but please advise more if we should have more condition such as … and…, …or…, …nor…

how to modify query_params rule?


basdebruin
  • Community Expert
  • January 16, 2024

Everything is in the docs, I suggest you play around in the API Playground. The query_params accepts an operator that can be either and or or.


  • New Participant
  • March 27, 2024

Hi Bas, is it possible to read a number value in a mirror column?

I’ve tried this query:



query {
 items (ids:[1234567890]) {
 column_values {
 ... on MirrorValue {
 display_value
 id
 }
 }
 }
}```

and it returns empty value for any mirror that contains numbers, for example subitems total column:

{
“data”: {
“items”: [
{
“column_values”: [
{},
{
“display_value”: “”,
“id”: “subitems_total”
},
{},
{}

    ]
  }
]

},
“account_id”: 12345678
}

Thank you!

basdebruin
  • Community Expert
  • March 27, 2024

It is possible to get an array of all numbers in the mirror column making up the total. In this query

{
  items(ids: 123456789) {
    column_values (ids: "subitems_numbers") {
      id
      value
      ... on MirrorValue {
        display_value
      }
    }
  }
}

the display value shows

{
  "data": {
    "items": [
      {
        "column_values": [
          {
            "id": "subitems_numbers",
            "value": null,
            "display_value": "8, 7, 60, 7, 8, 2, 4, 3, 10, 2, 3, 4, 6, 7, 7, 8, 9, 5, 1, 2, 3, 4, 6, 7, 7, 8, 9, 5, 1, 2, 3, 4, 6, 7, 7, 8, 9, 5"
          }
        ]
      }
    ]
  },
  "account_id": 123456
}