Accessing boards embedded in documents

Hi,

We’re working on an app that would greatly benefit from retrieving the board id of any board embedded in a document.

When I query the document blocks, I get a block of type board with content:

{
  "type": "board",
   "widgetId": <number>,
  "alignment": "left",
  "direction": "ltr",
  "didNewLayoutMigration": true
}

I haven’t found any information in the API documentation about accessing widgets or using the widgetId in order to retrieve information about the embedded board.

Is this possible at all?

Thanks in advance.

Hi Oscar,

Welcome to the community! Hope you are enjoying it here!

Would you be able to provide the query that was run to receive this object? We can take a look at that to see what is going on.

Best,
Joseph

1 Like

Hi Joseph,

Thank you for the warm welcome.

Some context: I created a document and embedded a board in it by typing /board in the user interface, which causes the “Board & Widgets” pop up menu to appear, then selecting the “Board” option, then selecting a board from the “Choose Board” menu that appears.

I’m issuing a simple query to retrieve the blocks of a work document:

  docs(ids: [${docId}]) {
    blocks {
      id
      parent_block_id
      created_at
      created_by {
        id
        name
      }
      updated_at
      position
      type
      content
    }
  }

where ${docId} is the id of a particular document that has a board embedded in it.

This works as expected and returns the document blocks. My issue is that the doc block that describes the embedded board only contains a widgetId as described in the original question. We need the id of the board.

Thanks again,
Oscar.

Hi Oscar,

Thank you for giving us more context. To clarify further, you state that the query works as expected but you want to retrieve the board ID using the widget ID or in general want to find a way to retrieve the board ID from this query?

Best,
Joseph

Hi Joseph,

The latter. I just need the board id(s) of the embedded board(s) in a doc. No need to go through the widgetId, I just mentioned it because it’s all I get at the moment.

Thanks again,
Oscar.

Hello there @oscar-alu,

It is not possible to do that right now.

I have created a request for our team, based on your question :grin:

Cheers,
Matias

1 Like

Thank you for looking into this and confirming @Matias.Monday .

Best,
Oscar.

2 Likes

Happy to help @oscar-alu !

1 Like