What you will need:
1) Getting your RunKeeper data
Easy, login to your Polar account and get your data.
After some processing on the website you should be able to download your data and you should get a zip file.
Inside the zip file you may find many files with the data you shared with Polar but what we want to get the data for Apple Health are the training session JSON files that should have names formatted like below:
“training-session-2001-01-01-2474820518-42d40fa4-d698-4252-8f74-59f8c1772737.json”
Note: To use the Shortcut from this post without any modification the file names must contain the “training-session” text and have the JSON extension.
2) Putting the data on your iPhone
The shortcut will look for the files inside the Shortcuts folder in your iPhone so the easiest way is to put all the training session files inside the Shortcuts folder using the iCloud web interface.
When you have Scriptable installed on your phone the app will create a folder in your iCloud Drive named, not surprisingly, Scriptable. The Javascript code and the Shortcut that I created will look for the CSV file in a subfolder of Scriptable that I have named ‘storage’. So if you would like to use the Shorcut without any modification just create a ‘storage’ folder inside the Scriptable folder and copy your “RKcardioActivities.csv” file inside it.
3) Create the Shortcut
This is the easy part because I have created it already but there are some limitations (of course). This shortcut can only recognise a few types of activities (the ones that I had in my CSV file), they are:
- Cycling – including indoor
- Running – including indoor
- Swimming
- Other – those activities I have logged in Apple Health as Walking
- Basketball
- Walking
- Badminton
- Hiking
Run the Shortcut and allow it the access to the data, I recommend that you first try importing only a couple of your activities at a time to check if it’s being done properly, especially for the duration. Then, once it’s ok, remove the redundant information and import everything.
To check the results you can go to the “Apple Health app > Workouts (scroll down) > Data Sources & Access (scroll down) > Shortcuts” and your imported data will be shown in there.
I had about 250 activities logged in Polar and the Shortcut took about 10 seconds to run so you can have an idea of the performance on an iPhone SE 2020.
Hope this helps.
Keep coding!