Get/fetch subitems from multiple items in a board

hi folks, hope all are doing well. i am working on monday apis in nodeJs using monday SDK, i got into a problem of fetching the subitems. i tried every possible way to fetch the data but no success


i am trying to get sub1 and sub 2, i have ids for “Legal Information” which is a group, then “Power of attorney” as subItem.
actually i want to get 3rd level items.

{
  boards(ids: [board_id]) {
    name
    id
    items(ids: some_item_id) {
      id
      name
      column_values(ids: "subitem_column_id") {
        id
        title
        value
      }
    }
  }
}

Hi @abdul

Welcome to the community. Not sure what you mean with 3rd level items, there are items and subitems and there is no third level. When you run your query the value from the subitems column should return something like this

“value”: “{“linkedPulseIds”:[{“linkedPulseId”:111111111},{“linkedPulseId”:2222222}]}”

If you JSON.parse that you can access the array with the itemIds of the subitems that you can query as a normal item.

@abdul,

It is also important to note that subitems exist in a seperate board.

thanks @basdebruin for looking into issue, but it does not work, it i query the items using the values from linkedPulseIds, then it is not showing any item.

{
  boards(ids: [board_id]) {
    name
    id
    items(ids: "value_from_linkedPulseId") {
      id
      name
    }
  }
}

@JCorrell thanks, but i did not get how to treat it like a separate board.

hi @abdul
You can’t query linkedPulseIds, you query the column_values (ids: “the-id-of-the-subitems column”) {value}. That returns: data.boards[0].items[0].column_values[0].value

You need to JSON.parse that into let’s say mySubitems, and then you can access: mySubitems.linkedPulseIds[ x ].linkedPulseId

i got your point,


but i want to get the sub-item name of the highlighted ones

i want to get these highlighted values

Sure, so you need to do a second query to query that item. In your example the second query will be:

query {
items(ids: 1540909612) {
name
}
}

great thanks, this worked for me.

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