Skip to main content

Item_page with scrolling_Menu on API

  • November 1, 2023
  • 5 replies
  • 201 views

  • Participating Frequently

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

5 replies

basdebruin
  • Community Expert
  • November 1, 2023

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
      }
    }
  }
}

  • Author
  • Participating Frequently
  • November 1, 2023

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


Matias.Monday
Forum|alt.badge.img
  • monday.com Team Member
  • November 1, 2023

Thank you so much @basdebruin !


basdebruin
  • Community Expert
  • November 1, 2023

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
      }
    }
  }
}

Matias.Monday
Forum|alt.badge.img
  • monday.com Team Member
  • November 2, 2023

Hello there @basdebruin,

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