Hi, I’m currently running problems trying to transfer a table to another doc.
I have a table with a canvas column; the canvases contain formatting, formulas, tables, images, etc. My end goal is to be able to transfer all the rows from this table without breaking their canvases’ object references. It’s also important to note that I’m not trying to keep these references alive; I just want to take a static snapshot of whatever’s currently rendered in the canvas, and transfer it to another doc. Additionally, I can’t just hard-code everything, as the content is dynamic and I don’t know what will be inside of them.
I tried using cross-doc tables as well as the API to transfer the canvases. However, this ruins the canvas formatting (even with rich value format). The only workaround that I’ve found is to convert the canvas object to JSON using _Merge, send it to the new doc, then from there, reconstruct the canvas using _Deref_Object. This preserves the formatting, but also causes any references to display as “Object not found!”.
I found a workaround for formulas, but it doesn’t work for tables:
- Traverse the canvas hierarchy, collecting all formula IDs
- Create the JSON representing a dummy canvas that references a formula by its ID
- Render the canvas using
_Deref_Object - Replace all formula references in the main canvas with the static text from the rendered dummy canvas
I’ve abused the formula system trying to figure out a way to transfer the tables, but have not had any success. It feels like there should be an easy way to do this, without having to use private functionality.
In theory, I could use the API to fetch the table rows from the source doc, but then there’s no way to transfer them to the destination doc. Even if this was possible, I would quickly hit the rate-limit for writing.
Am I missing something, or should I just give up on this approach??