Skip to main content

Hello.

I’m trying to create a new table with some content using document blocks API using the following graphql:

let query = `mutation {  create_doc_block (type: table, doc_id: 7546153, content: \\"{\\\\\\"row_count\\\\\\":2,\\\\\\"column_count\\\\\\":2,\\\\\\"alignment\\\\\\":\\\\\\"left\\\\\\",\\\\\\"direction\\\\\\":\\\\\\"ltr\\\\\\",\\\\\\"cells\\\\\\":[[{\\\\\\"blockId\\\\\\":\\\\\\"4f45589c-53be-4064-9d2e-bce4dae77fdf\\\\\\"}]]}\\") { id }}`;

But when I send it to monday I receive the following error:

unrecognized property [cells] in content

Could you guys help me on this?

Thank you!

Hello there @marcelo1,

What are you trying to achieve?

How should this table look like after creation?

Looking forward to hearing from you 🙂

Cheers,
Matias


Hey @Matias.Monday

The table should be like this:

I could create this table but I would like to insert some content on that.

Could I answer your question?


Hello again,

After creating a table with the 2 rows and 2 columns:

mutation{ create_doc_block(doc_id: 12345, type: table, content: "{\\"column_count\\":2,\\"row_count\\":2 }"){ content id } }

You would now get the in the response an array with all the cells IDs ordered by position.

Then you use the ID of the relevant cell:

mutation{ create_doc_block(parent_block_id: "71cd3sa-e6s3-4543-ds34-sfg43db5", doc_id: 12345, type: normal_text, content: "{\\"alignment\\":\\"left\\",\\"direction\\":\\"ltr\\",\\"deltaFormat\\":[{\\"insert\\":\\"My text inside the cell\\"}]}"){ id } }

I hope that helps!

Cheers,
Matias


Thanks for your response, @Matias.Monday

I’ll check this and let you know.


Sounds good @marcelo1 !