Skip to main content

Unrecognized property [cells] in content

  • September 6, 2023
  • 5 replies
  • 271 views

marcelo1

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!

5 replies

Matias.Monday
Forum|alt.badge.img
  • monday.com Team Member
  • September 6, 2023

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


marcelo1
  • Author
  • New Participant
  • September 6, 2023

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?


Matias.Monday
Forum|alt.badge.img
  • monday.com Team Member
  • September 10, 2023

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


marcelo1
  • Author
  • New Participant
  • September 15, 2023

Thanks for your response, @Matias.Monday

I’ll check this and let you know.


Matias.Monday
Forum|alt.badge.img
  • monday.com Team Member
  • September 18, 2023

Sounds good @marcelo1 !