How To Coda a ViewOrLayout II?

Handeling a confusing set up and having a great result

Christiaan Huizer
4 min readOct 11, 2024

--

We’ve all been there. You’re building a powerful Coda doc for your team, but different groups need to see and interact with the same data in unique ways. Event managers need certain fields, editors need others, and trying to cram everything into a single view just creates clutter and confusion.

My first instinct was to wrestle with if statements inside theOpenRow() function and try to shoehorn different modals into a single table. It felt like the "obvious" solution, but it didn’t work, nevertheless the impression is you can.

When I delved back into my own documentation, I stumbled (again) upon a surprising realization: you can't have multiple layouts for the same table.

This revelation came as a bit of a shock. The Coda documentation, while accurate, doesn’t explicitly state this limitation. It led me down a path of assuming I could magically conjure different layouts for a single table using just OpenRow().

The catch with layouts

The key lies in the concept of “views.” To achieve different layouts (i.e., different modals with unique fields and arrangements) for the same underlying data, you actually need multiple table views. Each view can then have its own dedicated modal, effectively creating the illusion of multiple layouts for a single table.

Why this matters

This nuance isn’t immediately obvious from the OpenRow() documentation. It's easy to misinterpret the "viewOrLayout" parameter as a way to switch between different layouts within the same table view.

This misconception can lead to wasted time and frustration as you try to achieve something that’s fundamentally not possible.

The solution

The solution is straightforward, though perhaps not as elegant as initially hoped:

  1. Create multiple table views: Create separate views for each team or purpose.
  2. Build dedicated modals: Create separate models for each view, containing only the relevant fields for that particular perspective.
  3. Employ OpenRow() in your button to direct users to the appropriate view and its corresponding model based on their role or the context of the data.
explaining the users how it works for them

The solution — based on different views of the same table looks as follows.

relating to the different modals, one per table view

The table views we’re referencing were created beforehand.

table views — each with their uniqu modal

This approach, using separate table views with unique modals, creates scalability issues. While it allows for a large number of modals, managing them becomes problematic. Referencing specific tables requires cumbersome workarounds like switchIf() statements because there’s no efficient way to directly access them. This lack of a clear referencing system hinders maintainability and increases complexity as the number of table views grows.

Tables are the heart of Coda, serving as both data repositories and dynamic displays through views like calendars, Kanban boards, and charts. While Coda offers a powerful array of views, there’s a hidden complexity when it comes to modals and layouts as explained. This often-overlooked aspect feels like an unfinished symphony, a powerful melody with a few discordant notes.

Coda’s strength lies in its ability to empower individuals to build custom solutions and share data in ways that suit their unique needs. However, this “unfinished business” around table modals creates a barrier to that vision.

My call to the Coda team is simple:

  • Refine and polish the table modal system. Introduce a more robust and intuitive way to reference and manage model layouts.
  • Improve the documentation. Provide clear, concise explanations and examples to dispel user confusion and empower makers.

These changes would harmonize Coda’s powerful features, making it easier for everyone to leverage the full potential of tables. By addressing this “unfinished symphony,” Coda can truly become the ultimate tool for collaborative data management and personalized workflows.

Let’s make Coda sing! 🎶

I hope this article was informative and helpful. Did it help you to solve a problem you unlike would have solved other ways? What about a donation?

My name is Christiaan, and I regularly blog about Coda. While this article is free, my professional services (including consultations) are not, but I’m always happy to chat and explore potential solutions. You can find my free contributions in the Coda Community and on X. The Coda Community is a fantastic resource for free insights, especially when you share a sample doc.

--

--

Christiaan Huizer

I write about how to Coda . You find blogs for beginners and experienced makers. I publish about 1 / week. Welcome!