I’m sorry but I have to say that this would not work either ![:innocent: :innocent:](https://emoji.discourse-cdn.com/apple/innocent.png?v=12)
And here’s why :
From the screenshot shared Ingredients.[On hand item?]
returns a list of boolean values (from Coda visual cues/hints at least, it’s apparently a checkbox field)… whereas thisRow.[Ingredients]
returns a list of rows from a table…
So you would end up with comparing true, false, true, true, true...
to Yellow onion, Tomato paste, Chili powder, ...
as text values
But, one way to get the formula to work (as you can only compare apples to apples in Coda to get your formula to work as expected) is to compare a list of rows to another list of rows or a list of text values to another list of text values
… which can be done either by filtering the table Ingredients
and find the rows where the field CurrentValue.[On hand item]
is True
which returns a list of rows and then compare that list to the list of rows in thisRow.Ingredients
…
And this would probably look like something like this :
Ingredients.Filter([On hand item]).ContainsAll(thisRow.Ingredients)
Or, if you want to compare a list of text values to a list of text values, in this case, you would still need to filter the table Ingredients
and find the rows where the field [On hand item]
is true
then dereference the text field used to store the name of the ingredients (in this case I assume (as it’s all I can do
) it’s been simply called Ingredient
and is probably the Display column of the table Ingredients
) … and the same can be done for thisRow.Ingredients
![:blush: :blush:](https://emoji.discourse-cdn.com/apple/blush.png?v=12)
You don’t need the ToText()
if the text value is already stored somewhere in the table, all you need to do is to gather it where it should
…
This would probably look like something like this :
Ingredients.Filter([On hand item]).Ingredient.ContainsAll(thisRow.Ingredients.Ingredient)
And as the whole ContainsAll()
formula returns either true
or false
(depending on if the condition is met or not), you don’t need the If()
… The checkbox will take the value of what ContainsAll()
returns ![:blush: :blush:](https://emoji.discourse-cdn.com/apple/blush.png?v=12)
Just to illustrate, here’s a quick sample …
There are 2 tables … Items
storing items and indicating if an item is on hand or not and the table Table
where I would like to know if it my “tests” can be done or not depending if I have all the items on hand or not … and which ones might be missing ![:blush: :blush:](https://emoji.discourse-cdn.com/apple/blush.png?v=12)
The formula in [Can be done - 1]
compares a list of rows to another list rows
Items.Filter([On Hand]).ContainsAll(thisRow.[Items - Needed])
And the the formula in [Can be done - 2]
compares a list of text values to another list of text values
Items.Filter([On Hand]).Item.ContainsAll(thisRow.[Items - Needed].Item)
I really really really hope you won’t take any of this in a bad way but I had the feeling that maybe some explanations were needed here
.