Exporting Health app data

I would like to use the Health app to record my daily blood glucose test results, but there doesn't seem to be any way to generate a report on the results for my doctor or export the data to a CSV or any other type of file. My doctor's practice is not set up yet to receive electronic results, so I still need to give him a hard-copy report. If anyone has figured this out, please let me know.

Posted on Oct 6, 2014 9:51 AM

Reply
Question marked as Top-ranking reply

Posted on May 31, 2015 3:50 AM

After struggling with the XML export and getting nowhere, I found a tip to download a free app: QS Access. It lets you build a table with only the data you want and easily exports it to any spreadsheet software. I had my BP and heart rate data in Excel with no messing around in less than a minute. Completely painless.

30 replies

Dec 30, 2014 12:01 PM in response to Stanley Horwitz

I had the same question. I couldn't figure out how to import xml data to Numbers or Excel for Mac 2011, but I found a way in LibreOffice using their Spreadsheet. I saved the xml file to the desktop, then opened a new spreadsheet in LibreOffice. Under the Data menu I selected XML Source. Click on the folder icon under "Source File" and find your xml file. In the window labeled "Map to Document", scroll down to "Record" and highlight it. This should highlight all the data labels related to your records (type, source, unit, value, etc.). In the "Mapped Cell" window, type "A1", then click Import. At this point, you can format as you like, or copy data to Numbers or Excel if you're more comfortable there.


Some notes on this:

(1) I couldn't find a way to edit the dates into a more readable format as M UND M describes for Excel. Since I measure daily, I just entered the date for the first day, then grabbed the lower right corner of the cell and dragged it down the column to fill in the dates myself. Or you could save the Libre file as a xlsx and then maybe M's instructions will work.

(2) Not sure if anyone else was this clumsy, but I had trouble finding a way to get the xml file in Health. You can't go straight from "Blood Pressure", "Heart Rate", etc. You have to go to "All" under Health Data and import a bunch of data you might not want. You can edit this out directly in the xml file (if you have access to Xcode or other software), or delete it after it's pasted into your spreadsheet.

(3) This is why I have 3 different types of spreadsheet software. None of them do everything I want!

Apr 11, 2016 2:50 PM in response to Stanley Horwitz

There's an easier workaround than downloading the app.


What really bugs me about the Health app is that it doesn't give you a grand total for a given time period (at least, I can't figure it out). When I click on my "year summary" of miles, I would like to see the TOTAL of my miles for the year. Not just my miles TODAY.


To get a sum of all the miles I have walked/run since the beginning of the year, I did this:


1. Export data to email by going to Health Data -> All --> Click on Share in upper right hand corner.

2. Download from email and open with Excel. When Excel gives an errors, say to open as TEXT.

3. I deleted any rows that were not related to Walk/Running.

4. Highlight the column that has this LONG string of text data that looks like this: "ning" sourceName="Name’s iPhone" sourceVersion="9.0.2" device="<<HKDevice: 0x12db4fe80>, name:iPhone, manufacturer:Apple, model:iPhone, hardware:iPhone6,1, software:9.0.2>" unit="mi" creationDate="2015-10-26 13:26:47 -0600" startDate="2015-10-26 12:43:40 -0600" endDate="2015-10-26 12:47:38 -0600" value="0.0362545"/>

5. Click on the "Data" tab and then click "Text to Column".

6. Selected "Delimited".

7. Then, under Delimiters, select "other" and put a quotation mark in the "other" field. (") And then click on Finish. What I found was that the mileage values I wanted were at the very end of this LONG string of text, but that there were quotation marks around these values. So, by delimiting the text by quotation marks, it will separate those values into their own column.

8. Sum the values to get your grand total.


So, YES you can use Excel to open the exported data.

And, YES you can easily split out all that text by using the "Text to Columns" tool.


(I'm using Excel 2011 for Mac)


DISCLAIMER:

I wrote all this really fast. I am by no means an Excel expert or an iPhone Health app expert. I'm just trying to help. I won't be able to answer any questions...

Dec 30, 2014 5:06 PM in response to not sold on lion

I downloaded phone view app. This allowed me to get at my app data which is store in anSQLite database. I was able to bring this into microsoft access and create the reports I want which I'll then dump to excel to chart my stats. I've still not figured out how everything is stored in the database though. I don't see a date field for the food entries or anything that might link to another source for dates. The dates are included in the exported csv file sent from the app so the combination of that and the sqlite/access process allows me to create the report I want with all the nutritional information I enter instead of the limited fields provided in the csv export from the app. All the non-food exports are fine.


I've got mac as my primary machine but still have my old laptop. I love my mac but I've got enough things that mac doesn't work well for that I think I'll always have both...

Nov 3, 2014 1:25 PM in response to rugburn

If you have not found a way to format the XML data yet here is at least one way:


1) Open a blank Excel Workbook.

2) For Excel 2007 or more recent, choose the Data tab on the top.

3) On the left side there is a 'Get External Data' block of choices, click the dropdown arrow on 'From Other Sources'.

4) Click on the third choice 'From XML Data Import'.

5) Find your downloaded XML file and click 'Open'.

6) Excel will likely display a message that the source does not refer to a schema. Choose 'OK'.

7) If you click 'OK' with the default choice 'XML table in existing worksheet', data will be displayed in Excel table format, which will let you sort and filter data. The other choices only displays the data in columns.


You will likely need to create an additional column for dates, as the 'startDate' and 'endDate' times are in a format that Excel won't recognize, if you need any date to your data anyway. If you need a conversion formula you can reply to this message stating as much. You probably already found that the export zip file shows detailed logs for every day on an hourly basis for the last week only, prior records at least in the export are summarized by day.

Jun 13, 2015 10:28 AM in response to CliveAH

QS access may work for some reports, but I found in Blood Glucose report, it changes the value to mg/ dL from mmol/L, and if you choose 1 Hour tab then you get the report for every hour even if you don't have any data points, and if you choose 1 day tab then the time is always 00:00.

I really don't understand why the Health app wasn't set up to be more user friendly and compatible with other software like numbers and excel...

Nov 17, 2014 8:11 AM in response to ludlowboy

Assuming that your startDate and endDate is in a column, do the following:


For a separate date and time column enter the following formula in a new column:


=DATE(LEFT({Cell with Data},4),MID({Cell with Data},5,2),MID({Cell with Data},7,2))

=TIME(MID({Cell with Data},9,2),MID({Cell with Data},11,2),)


You can fill (or copy paste) the formula down to encompass the full range of values you would like to convert.


You can also combine date and time in a single column by entering this formula:


=DATE(LEFT({Cell with Data},4),MID({Cell with Data},5,2),MID({Cell with Data},7,2))+TIME(MID({Cell with Data},9,2),MID({Cell with Data},11,2),)


Hope that works for you, and remember it appears that exported health data only shows daily summaries for any data older than 1 week, so the time stamp on that older data will reflect that.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Exporting Health app data

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.