{"slug": "i-automated-my-weight-logging-into-notion-and-gave-myself-a-new-daily-chore", "title": "I automated my weight logging into Notion, and gave myself a new daily chore", "summary": "A developer built an automated system to log weight data from a Withings Body Smart scale into Notion using Apple Health and iOS Shortcuts. The pipeline syncs weight and body fat percentage to a Notion database, with a formula column for rounding. The developer shared debugging tips, including using Quick Look to inspect JSON payloads and ensuring the POST action includes the JSON body.", "body_md": "I'm building a system where all my daily records live in Notion, so I can point an AI at it and get feedback. Goals, tasks, daily logs, finances — those are all manual entry, and that's fine. But one day it hit me that **weight** would be nice to sync automatically.\n\nThe requirements were simple:\n\nThat's it. My scale is a Withings Body Smart.\n\nThis one:\n\n```\nScale → vendor app → Apple Health → iOS Shortcut → Notion API\n```\n\nI chose Apple Health as the hub for these reasons:\n\nGeneric, zero cost, extensible. The design looked sound to me.\n\nHere's what the Shortcut looks like:\n\n```\n1. Find Health Samples          [Weight] latest, limit 1\n2. Get Details of Health Sample [Value]      → variable Kg\n3. Get Details of Health Sample [Start Date] → variable SampleDate\n4. Format Date                  yyyy-MM-dd   → variable Ymd\n5. If Ymd == today\n6.   Text                       ← build the JSON\n7.   Get Contents of URL        ← POST to the Notion API\n```\n\nStep 5 matters. Without it, on a day you don't step on the scale, **yesterday's weight gets appended under today's date**.\n\nHere's the JSON built in step 6:\n\n```\n{\n  \"parent\": { \"database_id\": \"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\" },\n  \"properties\": {\n    \"Date\":       { \"title\": [ { \"text\": { \"content\": \"@@YMD@@\" } } ] },\n    \"Measured\":   { \"date\": { \"start\": \"@@YMD@@\" } },\n    \"Weight kg\":  { \"number\": @@KG@@ },\n    \"Body fat %\": { \"number\": @@FAT@@ }\n  }\n}\n```\n\n(My real database uses Japanese property names. What matters is that they match your database exactly.)\n\nI write this as a plain string in a Text action and hand it to the POST action.\n\nNotion offers two auth methods for a connection: an internal access token, and OAuth. **OAuth is meant for apps that get installed into other people's workspaces, or listed on the Marketplace** — so for this I went with the access token.\n\n**Notion permissions are inherited by child pages.** If you connect an integration at a parent page, everything underneath it becomes reachable.\n\nIn my case I may want to auto-sync things other than weight later, so I granted access at the parent page that holds my personal data.\n\n`parent`\n\n```\n{\n  \"status\": 400,\n  \"code\": \"validation_error\",\n  \"message\": \"Provide a `parent.page_id` or `parent.database_id` parameter to create a page,\n              or use a public integration with `insert_content` capability.\n              Internal integrations aren't owned by a single user, so creating\n              workspace-level private pages is not supported.\"\n}\n```\n\nMy JSON *has* a `parent`\n\n. And I still got this.\n\n**The cause was that I never wired the JSON into the request body.** When I set up the POST action in Shortcuts, I hadn't configured it to actually take the JSON — so I was POSTing an empty body. Yeah.\n\n`invalid_json`\n\n```\n{ \"status\": 400, \"code\": \"invalid_json\", \"message\": \"Error parsing JSON body.\" }\n```\n\nWeight was appending fine, so I went to add body fat percentage. When I added the property, I forgot the trailing comma on the previous line.\n\n```\n    \"Weight kg\":  { \"number\": 67.878 }      ← no comma\n    \"Body fat %\": { \"number\": 16.058 }\n```\n\n**Shortcuts has no syntax highlighting and no linter**, so I walked right past it.\n\nDrop a **Quick Look** action immediately after the Text action. It shows you the expanded JSON exactly as it will be sent, so you can confirm the variables actually resolved to values.\n\nIn Shortcuts development this is effectively your only debugging tool. When you're stuck, look at the payload.\n\nThe weight coming out of Health was something like `67.87800598144531`\n\n.\n\nI first tried to round it inside Shortcuts, but **somehow I could not get it to work**, so I rounded on the Notion side instead.\n\nAdd one formula column to the weight database:\n\n```\nround(prop(\"Weight kg\") * 10) / 10\n```\n\nThen hide the raw column in the view and show only the rounded one. Much easier to read.\n\nAs a side effect this turned out to be the better design anyway: the raw value stays in the database, and rounding is a display concern.\n\nIt ran. Rows appeared in Notion.\n\nBut there was one problem left.\n\n**Apple Health doesn't get the data unless I open the Withings app.**\n\nStepping on the scale every morning isn't enough. If I want a row every day, I have to open the Withings app every day. Background App Refresh is on, and even then there's no guarantee it syncs daily.\n\nSo the actual workflow is:\n\nThe appending is automated now, but a daily manual step survived. What I actually wanted was for stepping on the scale to be the whole interaction.\n\nApple Health is a bucket that **gets written to when a connected app launches** — it isn't necessarily something that goes and fetches data on its own. I thought I was picking a hub. What I actually put in the middle of the path was a bucket waiting for the Withings app to open.\n\nMeanwhile, Withings has a public API. The scale is on Wi-Fi and presumably pushes measurements straight to the cloud, so a path like this might work:\n\n``` php\nScale --Wi-Fi--> Withings cloud --webhook--> my own endpoint --> Notion\n```\n\n**A row appears in Notion the moment I step on the scale. There's no app to open.**\n\nI picked Health because I wanted the design to be generic — but **the scale I actually own is one of the models that can skip that generic layer and be called directly**. By choosing \"a design that works with any scale,\" I missed the better path that only my scale had.\n\n**When you design an automation path, check up front whether each hop can push data forward on its own.** If even one hop is pull-based — it only moves data when something comes asking — that's where a human eventually ends up doing the work.\n\n*Originally published in Japanese on Zenn: 体重を自動でNotionに記録したかったが、毎朝アプリを開く仕事が残った*", "url": "https://wpnews.pro/news/i-automated-my-weight-logging-into-notion-and-gave-myself-a-new-daily-chore", "canonical_source": "https://dev.to/yukihiro_kimura_6bf70d8d6/i-automated-my-weight-logging-into-notion-and-gave-myself-a-new-daily-chore-2coa", "published_at": "2026-07-31 21:28:27+00:00", "updated_at": "2026-07-31 21:42:38.792955+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Notion", "Apple Health", "iOS Shortcuts", "Withings Body Smart"], "alternates": {"html": "https://wpnews.pro/news/i-automated-my-weight-logging-into-notion-and-gave-myself-a-new-daily-chore", "markdown": "https://wpnews.pro/news/i-automated-my-weight-logging-into-notion-and-gave-myself-a-new-daily-chore.md", "text": "https://wpnews.pro/news/i-automated-my-weight-logging-into-notion-and-gave-myself-a-new-daily-chore.txt", "jsonld": "https://wpnews.pro/news/i-automated-my-weight-logging-into-notion-and-gave-myself-a-new-daily-chore.jsonld"}}