How do I filter an Image from another table?

The image column on Table B contains multiple images that come from the image column on Table A.

When I try to filter to show only the image that matches the Name or Account, no images appear.

Could someone please help me with the correct formula? This is what I tried:

image

Here is the doc that anyone can edit.

1 Like

Hello, @Sarah_Zwier ! Try this formula :downwards_button:

At filtering we first get the entire table, second we write the parameters to the filter (Account from Table A is equal to this row Account), and after closing the filter, we use dot notation to get an column of this filtered table.

Result:


I Hope it helps you! If you have any questions feel free to ask!

2 Likes

An AI Support Agent Weighs In

To test the new Coda MCP server, I like to toss questions like this to an AI agent with a deep context of Coda CFL and the MCP. Here’s what it concluded. What’s kinda cool about this is that Coda MCP will actually validate the support agent’s recommendation by creating an actual Coda document with the recommended formulas and sample data. This has the benefit of basing recommendations on deterministic evals.

The assessment seems accurate, and the evals worked. I included the agent’s reasoning steps. Perhaps this is helpful.

Assessment

The accepted solution provided by user Kyton_Coda is absolutly correct and functional for the specific question asked.

Provided Formula:


[Table A].Filter(Account = thisRow.Account).Image

Verification Results:

  • I created a test document with Table A (Images) and Table B (Formula).

  • Implementing the suggested formula successfully pulled the image from Table A corresponding to the matching Account.

  • Note: The formula returns a List of images. If there is only one match, it displays as a single image, but the underlying data is a list.

Completeness & Improvements

While the answer is correct, there are nuances that could help the user if they are still facing issues (“no images appear”) or want a better long-term structure.

1. Troubleshooting “No Images Appear”

If the user’s formula is syntactically correct but returns nothing, the most common cause is a Data Type Mismatch.

  • Scenario: Table A.Account might be a Text column, while Table B.Account is a Lookup (row reference) or vice versa.

  • Fix: Ensure both are compared as text (e.g., Account.ToText() = thisRow.Account.ToText()) or, better yet, ensure both columns are the same type.

2. Best Practice: using First()

Since the goal is likely to display a single image for the account, appending .First() is cleaner. It converts the “List of 1 Image” into just “The Image”.


[Table A].Filter(Account = thisRow.Account).First().Image

3. Architecture: The “Coda Way” (Relation Columns)

Using Filter() in a column formula can be slow on large tables (O(N) operation per row). The idiomatic Coda approach is to use a Relation (Lookup) column.

Recommended Setup:

  1. Change Table B’s Account column to a Lookup column referencing Table A.

  2. Now, you have a direct link to the row in Table A.

  3. The formula for the image simplifies to dot-notation (O(1) access):


thisRow.Account.Image

This is significantly faster and less prone to spelling/text errors.

Suggested Response

Here is a comprehensive response you could post or use:


Response:

Your logic is sound! The formula suggested by @Kyton_Coda is correct for a direct filter:

[Table A].Filter(Account = thisRow.Account).Image

If you are seeing a blank result, check these two things:

  1. Data Types: Make sure the “Account” column in both tables is the same type. If one is a Text column and the other is a Lookup column, they won’t match. You might need to use .ToText() to force a match, but it’s better to align the column types.

  2. Lists: The Filter formula returns a list of rows. Even if there is only one match, Coda treats him as a list. Try adding .First() to be precise:

[Table A].Filter(Account = thisRow.Account).First().Image

Alternative (Better for performance):

If Account in Table B is intended to link to Table A, consider changing the column type of Account in Table B to a Relation (Lookup) pointing to Table A.

Then, you don’t need a filter at all! You can simply reference the image directly via the link:

thisRow.Account.Image

1 Like

Thank you so much @Kyton_Coda. Could I send you an Amazon gift card for your timely reply as a small gesture of my appreciation?

Hi @Bill_French I’m very interested in how you gave the request to the Coda MCP Server. Is this different than using the Coda AI assistant because I tried that and didn’t get anything like the results you posted.

Also, I don’t fully understand how to even ask the question to AI other than the post that I made here.

From a user perspective, this also brings up a couple of interactive issues:

  1. Why not have the Coda MCP server reply to each and every post in Ask the Community? This wouldn’t stop other users, especially if the reply is labeled as an AI agent and would help with making the AI agent better.

  2. Why not build the AI support agent directly into Coda so that it can look at a doc and with a little help from the user, determine what the user is trying to do. The Coda AI agent could even go through a doc, looking for any formulas that aren’t working and offer to help with each one.

The fact that the MCP gave an appropriate response it proof of the underlying intelligence but without making it easy for users it hamstrings the growth of Coda.

Please also ensure that the MCP is programmed morally as well, wouldn’t want it to be like the Tron MCP.

Yes, it’s significantly different. I used Google’s Antigravity as the agent framework, coupled with the new Coda MCP. I have also established my mcpOS™ tooling as a foundation for that agent. You can read more about mcpOS here - the source is also included in the appendix, although I hope to have a GitHub repo for it soon. It is essentially a super prompt: a collection of rules that are applied to all interactions with the Coda MCP server.

I’m not sure I do either, but we’re all learning, eh? :wink: My prompt in Antigravity was:

How can I filter an image field in a Coda table to display only the image relevant to the Account in the thisRow?

But it’s important to realize that I also gave it a fair amount of context, including the original article that we’re writing in. Antigravity supports browser sub-agents that are spun up dynamically to go read articles like this one when I’m using agentic processes that need these external contexts.

Funny you should ask. I had a conversation last night with Bharat (who’s leading the Coda MCP product team). I suggested exactly this kind of integration into the community, but the answer is a little more complex than just, “Yeah, it should.” There are many nuances that Coda has to consider.

This is another obvious need. The nature of utilizing Coda MCP inside Coda is a little more complicated than one might imagine; however, it’s exactly what I have suggested in various writings and even directly to Coda product managers.

I couldn’t agree more. However, the term “intelligence” is a debatable concept in general, but fundamentally, I agree with you. We are wrapping all of the necessary software, rules, and a deep understanding (which is to say, a deep context) about Coda in order to convince a stochastic parrot like Gemini to deliver the goods.

Indeed. However, let’s be clear: it is not the job of Coda MCP, or Coda itself, to serve as the morality police. Coda MCP has a charter: to allow authenticated users access to content in Coda and the ability to place content in Coda.

If you burden Coda’s MCP server with morality clauses, you’re going to create a problem in at least 179 other countries that don’t share any given definition of your morality. So, that’s the wrong place to apply such protective rules. Instead, things like this need to be governed on the agentic side, wherever an agent happens to be operating and connected to Coda and perhaps dozens of other applications that you might use. This is why I created mcpOS. It is a collection of rules that you are free to extend (you can even add morality clauses), and it will magically defend the inputs into Coda as well as the outputs in accordance with your rules.

But it has a broader reach, and why mcpOS is not hard-coded to work with Coda MCP only. The laws in mcpOS are designed to work with all MCP services because they apply to all interactions. For example, when you ask an AI agent to write something into a system, you should verify that the agent has indeed performed that write precisely as you intended. This is important because agents can hallucinate and say “I wrote it”.

The separation of agent-side tooling from all MCP interfaces is a critical imperative, which is why I am currently writing a fairly lengthy white paper on the separation of agentic operations from MCP servers. Coda, like all SaaS platforms are inclined to view tooling such as mcpOS as patterns that should be inside the MCP server. This is a mistake, and they should resist doing this because agent-MCP contracts must adhere to their technical constitutions.

Coda really needs a “missing manual” or better documentation for common use cases. Ultimately, any incorrect formulas should prompt with the Coda AI stating:

Based on your formula it appears that you are trying to do one of the following:

Then the AI could list the most common formulas based on what the user is trying to do.

Then the user would click the one that is closest and then the AI would help the user narrow down through Q&A.

Another option would be for formula building to start out with the user clicking what they are trying to do, a sort of choose-your-own adventure.

In the meantime, this software model could be tested outside of Coda by allowing the AI to have access to the Coda doc.

Is there any interest on your part in asking the AI to build a Coda AI interface that Coda could allow access to from within Coda’s share my doc form?

1 Like