Sample Food Vault for Tracking Consumed Nutrition Values

Some irrelevant comments

A Done is A Done. As long as it’s functional I am fine with how nasty the codes are…

  • Initially I do not intend to use Obsidian as a food consumption record app, since Excel exists and the idea of All-in-One just makes the vault complex. This complexity is the main reason why I archived my first vault and started a second one.
  • Later I found the mobile app that I used for food recording before had an unacceptable amount of ads and pop-ups, besides editing Excel files on phones seems… pathetic. Plus there is no way for me to bring my laptop near the food preparing area, so here I am.
  • There will be some loss in the calculation due to how I Round these values. Nutrition Values are just some estimation. The most important part is to Keep Calm and Take Care Ourselves :smile:

Download

How does the vault work

  1. Manually input one ingredients and its nutrition values (NV) per markdown file. These values will be processed to NV/gram and be stored in property. This includes Calorie(kJ), Protein, Fat, Carbohydrates and Sodium. Preset amount is also needed for easier input, like 125g/box of blueberries.
  2. Retreive Those Values using Templater, put them in different locations and ask Dataview to calculate and sum the values, as for how i did that… please download the vault because I myself also do not know how to explain the code.
  3. If it’s daily note, store the net weight of food and netValue of those 5 NVs mentioned above as properties. I do not feel like tracking them at the moment though, i made this because i wanted to see if i could achieve this

  • Thanks holroy for providing all kinds of dataviewjs answers on this forum!
  • Thanks GPT for helping me understand javascript and troubleshooting codes.
  • Hope you find this somewhat useful. I am happy if some of the part in this vault helps you!
1 Like

Nice idea. Thanks.