Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updating cells /rows in simple tables #42

Closed
maplat1 opened this issue Apr 20, 2022 · 5 comments · Fixed by #43
Closed

updating cells /rows in simple tables #42

maplat1 opened this issue Apr 20, 2022 · 5 comments · Fixed by #43
Milestone

Comments

@maplat1
Copy link

maplat1 commented Apr 20, 2022

Hey, looks like block updates with table row elements arent working (or I'm doing it the wrong way) - any help much appreciated

@seratch
Copy link
Owner

seratch commented Apr 20, 2022

Hey I'm not sure what your question is yet. Can you share a bit more details such as code and/or some examples using the official SDK?

@maplat1
Copy link
Author

maplat1 commented Apr 20, 2022

sure - I have a simple table (not a database table) on my page and want to update single cells

I can perfectly read the content of the table via getBlocksChildren("blockid of table")

no trying to update each block returned (a TableRow)

client.updateBlock( block.id!!, mapOf( BlockType.TableRow to BlockElementUpdate(cells) ) )

produces invalid JSON Got an error from Notion (status: 400, code: validation_error, message: body failed validation: body.table_row.cells should be defined, instead was undefined.)

hope that helps. As said not sure I'm doing something wrong but it feels like BlockElementUpdate data class only supports blocks with richText but does not have a "cells" property which would be needed here

thx for your help

@seratch
Copy link
Owner

seratch commented Apr 21, 2022

Thanks for sharing the details! The operation is not yet supported in this SDK. I just submitted a pull request resolving this. #43

I will release a new version shortly

seratch added a commit that referenced this issue Apr 21, 2022
@seratch
Copy link
Owner

seratch commented Apr 21, 2022

You can try v1.3.1

@maplat1
Copy link
Author

maplat1 commented Apr 21, 2022

thx for the fast turnaround! Working!

@seratch seratch added this to the 1.3.1 milestone May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants