Ability to sort `items_page` results by creation or last updated date

We recently added the ability to sort and filter items_page results by either their last updated or creation dates.

You can do so by entering either "__creation_log__" or "__last_updated__" as the column ID in the order_by field of your query. The items will be returned chronologically, with the oldest listed first.

Please note that you are not required to have a last updated or creation log column on your board to use this sorting mechanism.

The following example would return the first 50 items on board 1234567890 with a blank status column value, and they would be listed chronologically (oldest to newest) according to their creation date.

query {
  boards (ids: 1234567890){
    items_page (limit: 50, query_params: {order_by: [{column_id: "__creation_log__"}], rules: [{column_id: "status", compare_value: [5]}], operator: and}) {
      cursor
      items {
        id
        name
      }
    }
  }
}
2 Likes

Great news, Rachel! Can we filter by creation date, though?

Let’s say I want to filter items_page for items created today, is it possible?

Hi @gus.furtado!

The announcement mentions sorting by creation log, but you can also filter by it (see docs here)! However, this mechanism currently only allows you to filter by the user ID in the creation log column, not the timestamp.

I’ve opened up a feature request with our API team to see what we can do :slight_smile:

Best,
Rachel

1 Like

Thank you, @rachelatmonday !!!

1 Like