> [!tldr] A very powerful combination
This note may eventually be better written, but for now I'm going to copy/paste from my blog's article on my [[PDW|Data Journal]].
In my experience, the best bang for your buck toolset is **Google Sheets + [[Google Apps Script]]** _(the macro-like scripting engine behind Google’s productivity suite)_ **+ [[Shortcuts App|Siri Shortcuts]]** _(Apple’s wonderful scripting application)_.
![[DJ-High-Level.jpeg]]
### Google Sheet
The whole thing is built around a single “master” Google Sheets workbook. I made [this blank copy](https://docs.google.com/spreadsheets/d/1Etj94OzwHalVxl4DXkGyw4XXHL90khJAzT9Tl6KQHzA/edit?usp=sharing) for you to look around in.
![[DJ-Sheet.png]]
There is one sheet per each level of granularity you care to track. At a minimum I’d recommend sheets for Days, Weeks, Months, and Years. Each row in these sheets corresponds to one period of time, and you don’t skip rows. If you decide some things you want to track more frequently than “once/day”, then the best thing to do is add a sheet dedicated to tracking that thing. Each row in that sheet then represents one instance of that type of event.
Create columns for each piece of data you want to track in whatever sheet it belongs in. If it’s something that happens every day, put it in the `Days` sheet. Create additional columns with formulas in them to pull data from other sheets as desired. You could, for example, use an `averageif()` formula to pull a daily “Health” rating from the `Days` sheet into the `Weeks` sheet to see how your health is trending over the year. I include several “index” columns to make formulas easier for pulling data between spreadsheets. Each of the “one row per occurrence” sheets share a common schema for the first 6 columns:
![[DJ-schema.png]]
This allows you to use formulas like `countif()` and `averageif()` to select rows that belong to a given period of time.
![[DJ-Formulas.png]]
### Google Apps Script Web App - Your Own API
Create a Google Apps Script [using code like this](https://gist.github.com/aarongilly/78e9ea6380d1bdb3b3d23abf52b3f3e4)[5](https://aarongilly.com/Pages/Data-Journal#user-content-fn-5) to do 1, 2, or 3 things - in order I’d recommend:
1. `oneAM()` - Setup a nightly Trigger that auto-generate rows for you each day/week/month/year. This is a relatively simple process that makes the whole thing much less tedious.
2. `doPost()` - Publish a webapp to allow for writing data to the workbook from anything that can generate an HTTP POST request (e.g. Siri Shortcuts, IFTTT)
3. `doGet()` - Include a route on the webapp to allow for _retrieving_ data. I kept mine _relatively_ simple:
1. default behavior ⇒ return **today**’s data, and **year-to-date** data (see [Widgets with Scriptable](https://aarongilly.com/Pages/Data-Journal#widgets-with-scriptable) for why)
2. include `?export=sheetname` ⇒ downloads a [[CSV]] copy of whatever sheet’s name you supply (for automating local backups)
The secret sauce is really the automations to always have new rows created for each period of time AND to setup the doPost API route to allow automated data writing from Siri Shortcuts. These two things alone ensure you’ve got space to put stuff and that you’re putting at least _something_ in that space. Once you have _some_ data in a spot it becomes motivating to try to fill the blanks.
### Siri Shortcuts
The first part of the secret sauce was automatically creating one row per day, the _second_ part was making it **crazy easy** to get data into your system **using your phone, watch, or voice** via Siri Shortcuts. It’s as easy as:
![[DJ-Input-Scenario.png]]
Siri Shortcuts lets you input data from any Apple device by talking, typing, or even _doing nothing at all_ (when you set up automations). Getting data _in_ has never been so easy.
After setting up the WebApp, with literally _one_ action in a Siri Shortcut you can create an easy-to-trigger, easy-to-automate, easy-to-reuse Siri Shortcut for adding new data to your [[PDW|Data Journal]].
![[DJ-Shortcut.png]]
I have about a dozen Siri Shortcuts that look like that, each for inputting a specific kind of event data. Most of them I trigger using my voice or keyboard, but some are fully automated & I never trigger manually. For example - every night at 3:30am my phone sends to the Data Journal the city I am in. This `Sleep Location` metric I use to keep track of how often I’m traveling, and it happens without me doing _anything_.
****
# More
## Source
- self