I’ve tried creating several shortcuts, but I’ve not gotten the results I expected when querying HealthKit.
Here’s what I want. I use Calm as my daily meditation app. They are generally about 10 minutes in length each. I want to have an automation run at Noon and perhaps at a different time of day that reminds me to meditate if I have not yet logged at least 8 minutes to HealthKit Mindfulness.
I tried Find Health Samples and Get Details of Health Samples, but I was not getting back the number of Mindfulness minutes logged. I figure if I can get back a result of <5, I would set myself an alert, if it’s >8, it would just end.
I’m in a bit of a rush, so I can’t provide a full explanation, but hopefully I can point you in the right direction.
I have an automation set in Shortcut to run a shortcut (yeah, great naming skills, Apple) every day at the same time.
That shortcut checks if DataJar contains a variable that matches the current date.
If it does, it means I’ve already manually filled in data, so it stops without prompting me.
If it doesn’t, it runs another shortcut that asks me for the desired input. When that shortcut completes, it writes the current date in DataJar, signaling that for the day I’m done.
Thank you. That gave me exactly the kind of pattern I needed to understand how it works. I’m going to do the same thing now across a few HealthKit samples to give me reminders or check-ins during the day. I really appreciate your help to get me going.