I have a Coda doc for keeping track of what’s in my pantry and what recipes I can make from what’s in stock. The doc contains 2 tables: one of food items (“Whole Pantry” table) and one of recipes (“Recipes” table).
Can I get a bulleted list of all recipes, classified by a type (e.g. dinner), based off of what ingredients are in stock? For instance, if I have all the ingredients in stock to make, say, Fajitas, then that recipe would be listed.
This is what I have, but it doesn’t work: Recipes.filter(Type=Dinner)AND Whole Pantry.filter(In Stock=true).BulletedList()
I’ll add that I don’t think this formula would work because, tho it is filtering only one 1 type of recipe (e.g. dinner) and what ingredients are in stock, there seems to be a missing component to linking them. Like, I feel like it needs some kind of logic:
first check to see what ingredients are in stock
then check these ingredients against all recipes
filter recipes based on “dinner”
produce list of dinner recipes that can be made of what’s in stock
Ideally I’d like to have only ingredients and have the formula check to see if ingredients are available, and then suggest the recipe. Is that possible?
Hi @Jon_Schafer , I added a section called Search in your doc. Can you see if these options work for you and you can build on it and format it.
The steps here are -
Create a Multi Select List to select ingredients from
Filter the Recipes table using one of these filters ( depending on what you want)
Contains at least these ingredients -
Table filter - Ingredients.ContainsAll(ItemSelect)
Contains all of the ingredients selected -
Ingredients.ContainsOnly(ItemSelect)
Hmm. That’s a lot like Saul’s above which is helpful, but not quite what I’m after. If it helps, this whole started from this template: https://coda.io/t/Pantry-Recipes_tWHNAR9EljR
In that template, the creator has a formula that does what I’m after but I simplified my doc bc my needs aren’t as complex. Here’s the formula they used for generating the list of the Your Pantry section:
I like using columns in tables so my solution is a little different.
I changed the Ingredients table to a Lookup.
Then added a column to see what ingredients are available.
If all are then Can Cook is true.
You can then use Recipes.Filter([Can cook?]).Name.BulletedList() to get all the recipes you can cook.
Can you take a look at the doc and see if this is any better?
Hey - thanks for the nudge on Intercom - this TOTALLY works. I love the elegance of an “available” column and then the simple math to say if you can cook it. Thank you SO much for working with me on this!