API Filtering Items by Created Date Range

I am trying to utilize the Monday API for the purpose of seeing where our teams time tracking by two different tags (Tags, Type of Work). When I try an unfiltered look that collects columns groups and then attributes down to item column names, I am hit with the query complexity error and rightfully so. I would like to filter this query, but it doesn’t appear from the documentation in a manner that I believe would be best.

My thought is that beyond filtering by board id (as I am already doing), I would like to query items created between a specific time range (e.g. 1 month). Is there a way to do that? From the documentation it looks like the only possible values are “limit”, “page”, “ids” and “newest_field”.

Can anyone point me in the direction of how I can filter my query by date/time ranges or a good workaround to the complexity issue I’m facing?

Here is my query:

query {
    complexity {
        before
        after
        query
    }
    boards (ids: #########){
        columns {
            title
        }
        groups {
            title
            items {
                name
                column_values {
                    id
                    title
                    text
                    type
                    value
                }
            }    
        }
    }
}

Here is the error I am seeing right now:

{
    "errors": [
        {
            "message": "Query has complexity of 16011022, which exceeds max complexity of 10000000"
        }
    ],
    "account_id": #######
}

Hi @connor, I think this is not supported yet.
@dipro this would be great if we include this feature.

@connor,
With regard to the complexity issue, if you can move the group to into the items it will work…

 {
  complexity {
    before
    after
    query
  }
  boards(ids: #########) {
    columns {
      title
    }
    items {
      group {
        title
      }
      name
      column_values {
        id
        title
        text
        type
        value
      }
    }
  }
}
1 Like

You suggestion worked perfectly! Thanks for the help @JCorrell!

Good to know and I agree!