Is there a way to query subitems?

I’m looking for a way to search for a subitem by name in a specific item (which I have its ID).
My end game is to prevent duplication - If my query will find the subitem, I’ll leave it at that, but if it will not find it, an automation process will create it under the specific item.
I can’t look in the entire board since I might have a subitem by the same name but under a different item.
Any ideas on how I can achieve that?
I’m using the API and Integromat.

Thanks! :slight_smile:

It sounds like you understand the sub-item structure. So, I won’t go into that.

I believe that there are currently two options:

  1. Query the sub-items board using items_by_column_values on the name. Then loop through the returned items checking the group id for you parent item id.

  2. Query the sub-items board for every sub-item id on the parent item and check the names.

Which one is better depends to some degree on your use case. But, without knowing more, I would be inclined to use the first option only because the hist on the DB would be fewer.

1 Like