Is there no way to query subitems?

I’d like to query subitems where a date column matches a date range. This is possible for regular items by using items_page queries. Is this not possible at all for subitems? Any feasible workarounds?

Back in 2020 I think the answer was no.

You can but you must get the subitem board ID first, then use item_page on THAT board, rather than the main board ID.

You can get the subitem board ID from

{
 boards(id: 123123){
   columns(ids: "subitems") {
     settings_str
   }
 }
}

settings_str is a JSON string you can parse, and there is a boardId property (or boardIds) which contains the subitem board ID.

This query tends to be the easiest to get the ID.

Now you can query that subitem board as if it was a regular board.

Ahhh, that clears it up. I saw people talking about such a subitems board, but I wouldn’t have thought to look in the settings string. Cheers Cody!

The other way to get it to query an item for its subitems and have the subitems include their board ID. I don’t like this method because it results in retrieving items we don’t need and uses up more API complexity (plus since you may not know an item ID to retrieve on the board, you have to do an items_page with a limit of 1 on the board.) It gets messy that way. But I’m sharing it since it may be useful in other settings possibly.

{
  items {
    subitems {
      board {
        id
      }
    }
  }
}
1 Like

Thank you for the help @codyfrisch !!!