From Coda Table to Ready Print Document

This is my first time asking on this site. I hope I’m not doing anything wrong.

I’ve been using Coda for one year to support my office needs. Coda is amazing—with its affordable service and how advanced and complex things can be done, I’m quite happy. However, now I have an issue.

I created a table containing the inventory of my office’s electronic equipment. But now, I need to print a layout of the inventory data, which I will place as stickers.

However,now I’m confused about how to do it.

I know Coda can print pages, but does that mean I need to display the data as cards?

My table looks like this:

And the layout I want is like this:

Is there any suggestions on what I should do to get the layout? Do I need to use the Coda API to pull data from the inventory table and design it myself on a website? I’m hoping I can do it directly in Coda so i dont need to do another work. Thank you in advance !!

Hello @Kadar_Group

The PDF printing feature in Coda is quite limited—it simply converts your page or doc into a PDF file while maintaining the existing layout.

For your case, I see a few options:

  1. Create a custom page layout:
    You can create another page and design your desired layout there. While this approach has some limitations, with creativity and the use of Grids or other native features, you can achieve a result that closely matches your needs. This is the simplest method and relies entirely on Coda’s native functions.
  2. Use a Pack:
    Another option is to use a Word (.docx) template with placeholders and a Pack that replaces those placeholders with your Coda content. Essentially, you’ll construct a JSON string with the placeholders as keys, and the Pack will generate a .docx file populated with your data. Here are some Packs that can help:

I hope this helps clarify things a bit for you.

Best Regards,
Arnhold

1 Like

@Scott_Collier-Weir created a PDF pack that may help: Documint Pack, extend Coda with Documint - Coda

2 Likes

I forgot about Documint. It is another option for sure.

1 Like

Thank you so much Fel! i think i can do it with Create custom page layout and using grid for that.

But now the problem is, can we get data on looping in the grid ? so i just need to loop the data from table on them.

Hello @Kadar_Group

If you want to go this route, I think the best approach is to first create a layout and then apply it to every row. The trick is to use the canvas column to “calculate” the print layout, and then, on a new page, use the concatenate() or join() formula to visualize all of them.

Here is a simple example how to do it.

  1. I created a table to contain the print layout you’re aiming for. This table has a text column for the template name (in my case, “Name”) and a canvas column with the layout. In the canvas column, you can reference other columns using formulas. This way, every field you want to replace with row-specific information can be a formula.
    However, we are creating the layout in a second table, not directly in the data table. The trick is to build the formula with the data table in mind, not the template table. As a result, in the template, the formula might appear broken or invalid, but it will work correctly when applied.

  2. In your data table, create a canvas column. In the column options, select the template you created as the default value for new rows, and then apply it to all rows to update the existing ones.

  3. Last but not least, simply use the concatenate() or join() formula to display all rows. In the example, I used the join() formula with LineBreak() as the delimiter to add a line break between each element.

Here is a doc that demonstrates this:

Some notes:

  • You can first create the layout in a random row within the data table. This makes it easier to select the data in the formula. Once done, copy the content of the canvas column to the template.
  • The canvas column is highly flexible, so you can build almost any layout.
  • If you want to display the data in two columns, you can number each row and split the layout into two columns. In each column, use a formula to display the rows. For the left column, show only the odd-numbered rows, and for the right column, show the even-numbered ones (or vice versa).

I hope this helps you!

Best regards,
Arnhold

3 Likes

And before I forget (really cool song by Slipknot by the way), there’s another option: building an SVG image with your layout.

If you’re not familiar with SVG files, they are vectorized images that can be opened in a text editor, where you’ll see the image represented as code. There are examples in the Coda community demonstrating how to create and display SVG files in a Coda doc.

The advantage of this method is that you can create the exact layout you want. However, the downside is that you need to build the SVG file with placeholders that can be updated using formulas, which might be a bit complex.

Best regards
Arnhold

1 Like

this is amazing, i think i know how to do that. But let’s say on the last step. Can i do join join() formula with LineBreak() on the range how many row i want to display ?

lt’s say to make it more compact, i will make two column first, and then i do formula on column 1 to display the layout from row 1 to row 10, and then on column 2 i want to show layout from row 11 to 20

can we do that ?

Hey, @Felipe_Arnhold.
I really like you posts. You explain everything in very simple and well thought manner.
Could you please elaborate on how to display data in two columns, perhaps with a mock doc?

Hello everyone,

I don’t have much time to provide a complete answer today, but I just updated the doc I mentioned in my first post.

In that doc, I added two examples of using two columns. In both examples, I used Coda’s “native” columns, but you can also use Grids if you prefer.

Here’s a quick overview of what I did:

  1. First Example:
    I added a column to the data table called “Position,” which calculates the position of each row in the table. I then used a filter to display the odd-numbered rows in the first column and the even-numbered rows in the second column.
  2. Second Example:
    I implemented what @Kadar_Group requested: placing the first 10 rows in the first column and all remaining rows in the second column.

You can easily update the formulas to extend the functionality. Just copy the doc to view and experiment with the formulas.

If I have more time later today, I’ll explain the approach in more detail.

Best regards,
Arnhold

1 Like