Items_page sort items by updated_at/created_at

I am trying out the new items_page endpoint.

What I am trying to achieve is to fetch the 10 most recent items assigned to me. Where “recent” implies that the item has been created or updated recently.

I am current using this query:

boards (ids: [3576472011 3576476533]){
    id
    name
    items_page (query_params: {rules: [{column_id: "person", compare_value: ["assigned_to_me"], operator: any_of}
    
  ]}, limit: 500) {
      items {
        id
        created_at
        updated_at
      }
    }

   
  }

I fetch up to 500 items per board and then do the sort myself by querying the created_at and updated_at dates, is there a way to sort the items in the request so that I do not have to fetch 500 items and potentially miss out on 501-xxxx?

hi @timovanderkamp

Have you tried the order_by on the items_page as described here Migration guide - 2023-10

Not sure if created_at and updated_at are supported and how this would work on multiple boards. It does seem to work with the creation_log, but not sure if it compares the person or the date part of the creation_log.

query {
  boards (ids:123456789) {
    items_page(query_params: {
      order_by: [
        {column_id:"creation_log4", direction: desc}
      ]
    }) {
      items {
        id
        name
      }
    }
  }
}

Hi @basdebruin ,

Yes I have tried the order_by query param but with no success. The creation_log column seems to be a custom column, I can not find it on my boards.

hi @timovanderkamp

What kind of columns are your created_at and updated_at. The “creation log” column is just another column that you can add to your board.

I think I’m having the same issue.

updated_at and created_at seem to be fields that are added by Monday, so they aren’t columns on the board. However it does not allow you to use those fields to order_by.

The fields clearly exist as you can see it returns data in the first screen shot. However when you try use it, it gives an error saying that it does not exist.

hi @justinvandyk

See some good news here: https://community.monday.com/t/using-order-by-creation-date-in-2023-10/66116/4

Hi @basdebruin

It says the page does not exist or I do not have access :thinking:

hi @timovanderkamp

Oops, this is a closed workspace (developers only). The latest from monday was:

1 Like

Thank you @basdebruin for bringing the good news!!

Thanks Bas! Has there been any movement on this? I’ve tested again but query still fails in bot 2023-10 and dev version of the API.

query_params: {
      order_by: [
        {column_id:"updated_at", direction: desc}
      ]
    }

hi @justinvandyk

No update yet, but expected this week / next week (as mentioned by monday team)

1 Like

Hello everyone! This will be coming soon. We will update here when it does!

1 Like