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.
Any pointers on getting me moving on this quest?
Something like this Shortcut hopefully will be what you are after.
Hope this helps.
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.
Wow, that looks promising. I’m going to give it a try. I did not think about checking it that way with the repeat. Thank you. I’ll give it a try.
I had also wondered about trying a Data Jar record. I’m going to take a look at this too. Thank you for your help.
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.