Relation table formula problem

Hi Coda wizards,

Here is my problem: I have a table of prompts with categories.
Then I have a table of those categories where I need to show a number of prompts in each category.

Where is my mistake in the formula as right now it is showing the total number of prompts everywhere?

Hello @M_G

Your “Prompt Category” column is a relation to the “Prompt Categories” table, so what is inside this column is an object, not a text.
Try to remove the “.Name” property.

[AI Prompts].filter([Prompt Category].Contains(thisRow)).Count()

Best regards,
Arnhold

@Felipe_Arnhold I tried that - everything changed to zero:

I think the issue is that you have:
[AI Prompts].filter([AI Prompts.Prompt Category].Contains(thisRow)).Count()

But you want, exactly as Arnhold wrote,
[AI Prompts].filter([Prompt Category].Contains(thisRow)).Count()

You should reference CurrentValue.Prompt Category instead of a second reference to the AI Prompt table inside of the AI Prompt filter.

1 Like

As johan says,
you have to use the currentValue of prompt category

[AI Prompts].filter(CurrentValue.[Prompt Category].Contains(thisRow)).Count()
1 Like

You guys are awesome. Thank you very much!