Order of subitems

How do I get the order of my subitems??

I have an item where the user chooses from a list of board IDs and then clicks a button.
The button triggers Make.com to take all of the item’s subitems and recreate them as items in the selected board.

These subitems are being retrieved in order of their item IDs but surely no one is ever going to want to order them by their IDs!

How on earth do I keep/find the order in which these subitems are displayed originally??

It took me 30 minutes to set up the whole automation and get it working. Then I spent the next 2 hours until home time trying to figure out how to fix the ordering.

I’m getting very frustrated trying to find a work around to something that should be working as a basic minimum. Am I missing something obvious? It should be obvious…

hi @TPCouriers

Unfortunately monday does not have a concept of “order”. Users can drag and drop columns, items and subitems in any order they like. You could try to use the newest_first field to sort the items or the created_at property which gives you an order of “oldest” to “newest”, but not the order which appears in the UI.

An items/subitems order property must be stored somewhere, at least to list the items in a custom order that’s not a simple “order by column value”.
It would be really useful if such value were available thru API.

1 Like

They clearly have some way of knowing the order the user has chosen though because otherwise it would forget each time you reload the board. In my use case the order the user chooses is just as important as the items themselves.

It’s impractical to expect users to redo an “order” column every time something changes, which is the work around I’m currently having to use (and to make it worse, Make.com reads my “order” column as text and not numeric when I try to sort, so I’ve had to change it to a text column and use 01, 02, 03 etc).

1 Like

Sure an “order” is stored somewhere, but just not accessible through the API.

Hello everyone,

As Bas mentioned, the order itself is not available via API.

Having said that, I want to thank you for the feedback and I will add it to our request for a “order” field to be available via API.

Cheers,
Matias

2 Likes

Any updates on this and does the product team even notice all the problems discussed in this community?

I am running into new problems and limitations with Monday every single day. All of which were discussed in this forum multiple times. All of which super basic things. Please listen to your users.

It would be nice to prioritize this problem as the change in the API should be done within an hour (estimate from a coder who implemented multple APIs).

3 Likes

Hello @MondayUser123123,

I do not have an update on this as of today.

If you have any technical issues, please send us an email to appsupport@monday.com and we will be glad to take a look into it for you :grin:

Cheers,
Matias

I’ve found a couple of ways to order subitems. Posting here for posterity.

If there was a __parent_id__ special column id that could be used in an [ItemsQueryRule!], like __item_id__ can, that’d be AMAZING! We should also be able to use the __last_updated__ and __creation_log__ in an [ItemsQueryRule!].

Use subitem ids directly (items)

{
  items(ids: [<comma-delimited list of subitem ids>] newest_first: true) {
    id
    name
    column_values {
      id
      text
    }
  }
}

Use subitem ids directly (items_page)
The example below also returns newest first. You could use __last_updated__ if you want to order by which ones are newly modified.

{
  boards(ids: <subitem's board id (different than item's board id)>) {
    items_page(
      query_params: {
        rules: [
        	{column_id: "__item_id__", compare_value: [<comma-delimited list of subitem ids>], operator: any_of}
      	], 
        operator: and,
        order_by: [{column_id:"__creation_log__", direction: desc}]
      }
    ) {
      items {
        id
        name
        column_values {
          id
          text
        }
      }
    }
  }
}

Search by something in the subitem

{
  boards(ids: <subitem's board id (different than item's board id)>) {
    items_page(
      query_params: {
        rules: [
        	{column_id: "<date column id>", compare_value: ["2024-01-01", "2024-12-31"], operator: between}
      	], 
        operator: and,
        order_by: [{column_id:"__creation_log__", direction: desc}]
      }
    ) {
      items {
        id
        name
        column_values {
          id
          text
        }
      }
    }
  }
}

You can get the subitem board id via:
The item’s board id is found in the Monday.com url after /boards/.

{
  boards(ids: <item's board id>) {
    items_page {
      items {
        subitems {
          board {
            id
          }
        }
      }
    }
  }
}