Seeking help with Formulas

Hello everyone!

I am here seeking your knowledge because i am having a hard time figuring what i am doing wrong with this Doc.

Right now this is a doc for a Meal Planner that i followed from this video but somewhere i may had lost the track of the information, i rewatched the video but still the same output.

The doc has 3 pages, Ingredientes ( Ingredients ) , Meal Plan and Refeições ( Recipes ) .

What I wanted to get as a result is in the Ingredients doc, the View of Ingredients to be more precise.

I wanted to find all the ingredients that belong to existing recipes in the Meal Plan and the status of the meal is “In progress” and apply a filter in this view to find everything that is in the meal plan AND is out of stock, in order to transform this view on a shopping list.

At one point I saw that, as it was a selection list, I would have to “flatten” the list in order to get the result I wanted, but I’ve tried different ways and :

    a) Returns all columns to True, even if there are no meals in the Meal Plan or they are marked with the status "Done"
    b) Returns the information I want, but does not update, so that if I change the status to "Done" in the Meal Plan, the view does not update the information.

Can you take a look at the doc to indicate where the errors are and how I can correct them?
Or even better, suggest a different approach to this!

Copy of the doc

Hi @Gabriel_Moreira_Santana and Welcome to the Community :partying_face: !

I’m not entirely I did the right thing here :sweat_smile: but, does the your [View of Ingredientes] now displays the ingredients you wanted it to display ?

I’ve modified the formula in the text field Column 5 and used that field to filter the view :blush:
(Look in the Options of the view → Filter)

Just Perfect!
That was exactly what i was looking for!
Can you guide me on where i was doing wrong? From a first inspection on your formula, i did messed up with the AND clause and did not use the sort too, was that all ?
Thank you for your help!

My pleasure @Gabriel_Moreira_Santana :grin: !

As far as I can remember, I changed this and I think I converted the Recipe multi-select relation field in the Planner table into a single select one (forgot to mention this in my previous reply, sorry :innocent: ) as one can only plan to eat one meal at a specific moment in a day.

The Sort() in the formula in the [Column 5] in the Ingredients table is somewhat optional though … I’ve just added it so the first recipe appearing in the list of rows would be the “earliest planned” one which I just thought might be useful at some point, depending on how your doc grows :blush: .

I also guess you could use a multi select relation field instead of a text field for your [Column 5] (with the same formula) as this might allow you to do more things with that field (if needed), more easily :blush: .
But again, this depends on where you want to ultimately take your doc.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.