Skip to main content

Fetching items by column value and group id

  • January 3, 2021
  • 5 replies
  • 3877 views

Hi,
I have a board with two groups, and i want to be able to fetch an item by a specific column id, but it exists on both groups.
Is it possible to fetch items by column value and group id at the same time?

This topic has been closed for replies.

5 replies

LaurentConroux
  • Participating Frequently
  • January 4, 2021

Hey @eilon,

I do not believe we can do that at the request level.

However you can ask for the group in the item request, and then filter out the other groups from the results data.

Hope it helps
Laurent


  • Author
  • New Participant
  • January 4, 2021

Thanks For answering, I actually thought of that too, but once I send that query I only get one item (even though there are two that fit my query, one in each group).
Do I do something wrong?

 query = """
                query
                {
                    items_by_column_values
                        (
                            board_id: %s,
                            column_id: %s,
                            column_value: "%s"
                        )
                         {
                            id
                            name
                            column_values{
                                id
                                title
                                text
                                value
        
                            }
                            group{
                                id
                                title
                            }
                        }
                        }
        
                """%(board_id, column_id, column_value)
        data = {"query": query}
        res = requests.post(self.base_url, json=data, headers=self.headers)

LaurentConroux
  • Participating Frequently
  • January 4, 2021

You are right: it should work.

I checked that query on my account playground and it works fine.
I used 2 items in 2 different groups with same status value (Done).


Forum|alt.badge.img
  • monday.com Team Member
  • March 3, 2021

Hi @eilon! Are you still running into this issue?

I tested this out on my end and am also seeing two responses.


  • March 15, 2021

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