Item_page with scrolling_Menu on API

Hello,
I’m contacting you because I would like some clarification on an API-related matter. I wanted to know if it’s currently possible with the “Items_page” function to filter two or more names from a dropdown menu. If so, how? I tested it with this format: “[{column_id: “scrolling_Menu”, compare_value: [“word1”, “word2”], operator: contains_text}]”, but only the information for “word1” is displayed, and “word2” is ignored. I know it works with individuals or text because it worked during testing and in the documentation.

Sincerely, Delépine Tom

hi @TomDel

Looks like the contains_text operator does not support an array of compare values. Instead you can do this:

{
  boards(ids: [123456789]) {
    items_page(
      query_params: {rules: [{column_id: "dropdown", compare_value: ["label1"], operator: contains_text}, {column_id: "dropdown", compare_value: ["label2"], operator: contains_text}], operator: or}
    ) {
      cursor
      items {
        id
        name
      }
    }
  }
}

When using the labelId and operator any_of you can use an array of compare values, like:

{
  boards(ids: [123456789]) {
    items_page(
      query_params: {rules: [{column_id: "dropdown", compare_value: [1, 2], operator: any_of}]}
    ) {
      cursor
      items {
        id
        name
      }
    }
  }
}
1 Like

Hello,
thank you for your response. It is clearer now, and I appreciate it.

1 Like

Thank you so much @basdebruin !

1 Like

Hi Matias,

Is it intended behavior that the contains_text operator does only compare with the first given text value in the array? This one gives only the items that containls “label1”, not “label2”

{
  boards(ids: [4048117859]) {
    items_page(
      query_params: {rules: [{column_id: "dropdown", compare_value: ["label1", "label2"], operator:contains_text}], operator: or}
    ) {
      cursor
      items {
        id
        name
      }
    }
  }
}
1 Like

Hello there @basdebruin,

That is intended behavior. For items_page, contains_text accepts one value only :grin:

1 Like