How to determine whether a board is a subitem board via the API

Hello, please can you provide a definitive answer:

  • What is the purpose of the pos field on a Board API query?
  • Can the value of the pos field be relied upon to indicate whether the board is a standard/parent board or subitem board?

A similar question was previously raised here, but the way the answer (which was inconclusive) was written indicates that it was a guess, rather than a definitive answer based on factual knowledge of the API, which should be available within Monday.

The API documentation for boards gives a limited and uninformative description:

  • pos String: The position of the board.

The information that both of these resources provide is unsatisfactory.
However, this is a simple question and should be very straightforward for someone at Monday who has knowledge of the API, to answer.

Please advise on this, or if an alternative method of reliably distinguishing standard/parent boards from subitem boards via the API is know, please recommend it.
Many thanks for your help!

1 Like

Hello!
Let me show you the way how I tried to distinguish regular boards from “subboards”.
This is my configuration:

Let’s perform this query to get subboard’s item list:

query ($boardId: Int) {
  boards (ids: [$boardId]) {
    items {
      id
      name
      creator {
        id
      }
      creator_id
      parent_item {
        id
      }
    }
  }
}

The result is:

As you can see there is a “phantom” item at the first place. You will never see such item in “regular” board. It always has named as “Subitem”, has no creator, has no parent_item (as well as items of “regular” boards) and has unknown id and creator_id. If you try get this item or creator using url (/boards/:subboard_id/pulses/:subitem_id or /users/:creator_id) you will face errors:

So the answer for your question is this js-pseudocode:

const items = response.data.boards[0].items;
let isSubBoard = false;

if (items.length && items[0].name === 'Subitem' && items[0].creator === null) {
  isSubBoard = true;
}

P.S: you can also limit your item list to only 1 item to decrease query complexity using (limit: 1)

1 Like

Thank you for sharing your detailed approach @lays :slightly_smiling_face:
The images and thoroughness is helpful and greatly appreciated!

However, this is ultimately still leaves us without a definitive, reliable and explicit answer to the question.

My current approach is to infer the type based on the board name prefix “Subitems of”, but as mitko-slapdash pointed out, placing reliance on this could be problematic. In both cases, yours and my approach imply an uncertain answer, rather than giving the explicit answer I am after.

Regarding the existence of a “phantom” item, this only raises further questions. Instead of resorting to the use of one undocumented feature to resolve ambiguities in another undocumented feature, Monday should be able to give us an explicit answer to the question above.

Riddle me this...

2 Likes

Hello @TomUK !

The pos field should not be used for this. It is going to be deprecated.

You could query for an item inside the board, and then use that item’s ID to check if it has a parent item. If it does, you are looking a subitems board. If the response is “null” then it is an items board.

{
  items(ids:0123456789){
    parent_item {
      id
    }
  }
}

This would require for the board to have at least one item.

What do you think?

Thanks for your answer @Matias.Monday.

It is disappointing to know that pos is due to be deprecated yet this is not documented in either the API docs or in the API schema, as it should be. This really harms confidence in the reliability of both of these resources.

It appears our conclusion is: there is no way to reliably determine whether a board is a subitem board via the API. Several methods exist to indirectly determine, by querying items, that there may be a high probability a board is a subitem board, but each method has its shortcomings and none should be relied upon in a production application.

Ideally there would be a boolean field is_subitem_board on the board query.

2 Likes

Hello again @TomUK ,

Thank you for the feedback!

I will share it with the team so that we can take a look into it.

Cheers,
Matias

I totally agree with you that this should be documented and there should be a better way to query for this (love your meme btw). I’m currently also using the board name prefix “Subitems of” to determine if a board is a subitems board as was recommended in various posts in this community. Now I’ve been noticing that a customer from Portugal sometimes has the prefix Subelementos de for their board names.

I wonder if subitem board names are now being saved as the translated localized string instead of the “Subitems of” prefix.

@Matias.Monday can you shed some light on this?

2 Likes

If you’ll query subboard’s items you’ll face with “phantom” item at the first place as I showed on screenshot in my answer above. This “phantom” item also has null on parent_item field.
So this would require for the board to have at least two items because you’ll never know if it’s first item of “regular” board or “phantom” item of subboard.

Hello all!

@fatih yes. The prefix for the name of the subitems board will vary depending on the language.

@lays that is strange. I can not reproduce this “phantom” item issue. Would you please send us an email to appsupport@monday.com about it so we can give it some following and look for the source of the issue?

To the best of my knowledge, currently there is no definite way to know whether a board is a subitem board or not. All the suggested answers fail in one way or the other. The pos variable has been proven not be reliable and will be deprecated at some point. The suggested parent_item doesn’t work for new created sub-item columns with no added items. When you query such a board, you will receive null just like the regular board.
It’s unfortunate that, monday.com doesn’t realize that, this is a huge problem that needs a fix as quick as possible, especially because, sub-items are created differently than regular items. Without knowing whether a board is a sub-item board or not, how do you go about knowing the right mutation to use.

The right and expected solution is that, a sub-item board should have a flag that indicates that it is a sub-item board and the parent board or parent board id in which it resides. This is the bare minimum any developer will expect without even opening the API documentation, but alas, monday.com thinks differently

3 Likes

I cannot agree more.
Both lack of documentation and is_sub_item_board [boolean] field or similar represent major issues.
Looking forward to the Monday Developer Team to address those ASAP.

Hello @kolaai and @VasylTretiakov!

Thank you for your feedback :slightly_smiling_face:

I have added your votes towards this feature request.

Cheers,
Matias

1 Like

This is now fixed with: Introducing board type :tada:

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.