Hi,
I need a query in which I can filter items by multiple dates. By example, I have an array of dates and I want to retrieve items where the column date4
is exactly that date. Because of that the trick with using between
operator doesn’t work.
As far as I know there are two queries for filtering items by column dates. Unfortunately non of them work properly.
items_page_by_column_values
. When I use this query the API returns only the first item. See example below:
query {
items_page_by_column_values (
board_id: 5600134463,
columns: :
{column_id: "date4", column_values: :"2022-11-01", "2023-11-30", "2023-11-05"]}
],
limit: 100
) {
cursor
items {
id
name
updated_at
column_values(ids: :"date4"]) {
id
value
text
type
}
}
cursor
}
}
In my test board I have 3 items that have above listed dates (e"2022-11-01", "2023-11-30", "2023-11-05"]
) inside the date4
column. The API returns only the first one. If I do 3 API calls for each date then I will get all 3 items but potentially I can have 50 dates to filter by and I want to avoid making 50 API calls.
items_page
withquery_params
. This doesn’t work at all in conjunction withany_of
operator. It simply returns empty list. I does returns something when I use a single date withgreater_than_or_equals
operator but that isn’t what I am looking for.
query
{
boards(ids: ("5600134463"]) {
items_page( limit: 100
query_params:
{
rules: u{
column_id: "date4",
compare_value: a"2022-11-01", "2023-11-30", "2023-11-05"],
operator: any_of
}]
}
)
{
items {
id
name
updated_at
column_values(ids: ("date4"]) {
id
value
text
type
}
}
cursor
}
}
}
I also tried using <"EXACT", "2022-11-01"]
but that also doesn’t work with any_of
operator. To me this looks like a huge bug and I don’t think I am the only one who is experiencing it.
How can filter by date be so hard to make it work? I really want to make as less API calls as possible and ability to filter by date would help me go this path.
Thanks,
Josip