It there a built in method or function to return connected items in another board

I’m looking for a way to place the number of connected items in another connect board into an number collumn. in landlords i would like to see how many properties.

Hello there @dsullivan2 and welcome to the community!

I hope you like it here :muscle:

Let me know if I understand correctly. You have a “connect_boards” column and a “numbers” column. You want to know how many items are connected in the “connect_boards” column and show that number in the “numbers” column. Is that accurate?

If so, you can check the number of items with a query like this one:

{
  items(ids: 123456789) {
    column_values(ids: "connect_boards") {
      value
    }
  }
}

You would need to change the ID of the column for your column’s ID if it is different.

Then you can check the number of results you get (with a script on your end), and then you can send that number to the “numbers” column with a mutation like this one:

mutation {
  change_simple_column_value(
    board_id: 1122334455
    item_id: 1234567890
    column_id: "numbers"
    value: "10"
  ) {
    id
  }
}

Let me know if that is what you were looking for!

Cheers,
Matias

To add on to what Matias said:

The next version of our API contains an update for the connect-boards column to make accessing linked items easier.

Introducing the BoardRelationValue type

These column values have the BoardRelationValue type, which contains some useful fields on it:

Using this in a query

Specifically you can grab the linked_item_ids field and check its length, with a query like this:

query {
  boards (ids:12345) {
    items_page (limit:25) {
      items {
       	id
      	column_values {
        	...on BoardRelationValue {
         	 linked_item_ids
        	}
      	} 
      }
    }
  }
}

How to switch API versions

Oh, and you can switch API versions using these instructions.

Let me know if that helps.

Matias,

Thak you for your help. I’m not sure where I would run a query. Your solution is probably over my head. I was looking for a solution to capture those counts already done in Monday and put the number in a field such as this.

image002.png

Hey Dennis – I understand now, thanks for letting us know. Your post was in the developers’ section so we immediately jumped to a custom development solution :cowboy_hat_face: Sorry about that!

So, to recap – you’re looking to count the number of items on a board, using something like a formula column.

You can do this by using the #count helper in the formula column:

PS: I’m going to move this over to the main platform discussions of the community!