Developer Forums relocated!

Need help with Apple Developer tools and technologies? Want to share information with other developers and Apple engineers? Visit Developer Forums at Apple.

apple health data export does not work

hi, the apple health export to xml does not work. the exported files can’t be opened, there is a “dtd” error.

my ios is 16.4.1.

any solution?

the difficult solutions i found suggesting some coding are to complicated for me. i’m surprised to be honest exporting simple data doesn’t work.

iPhone XR

Posted on Apr 27, 2023 2:28 PM

Reply
Question marked as Best reply

Posted on Apr 30, 2023 5:32 PM

ulrich265 wrote:

i just opened the file in some editor and i can see all the data now. unfortunately the is only root <healthdata> and child <record> and all the data saved in attributes. so e.g. if i want to get systolic blood pressure i have to look for type and value attibute. i guess there is no other solution than some coding. python? any suggestions?

As I said, look for an app that already does this. Here is an example: https://www.ericwolter.com/projects/apple-health-export/


I know nothing about the app or it's developer. Could be a scam. Doesn't look like one. Could be others.

11 replies
Question marked as Best reply

Apr 30, 2023 5:32 PM in response to ulrich265

ulrich265 wrote:

i just opened the file in some editor and i can see all the data now. unfortunately the is only root <healthdata> and child <record> and all the data saved in attributes. so e.g. if i want to get systolic blood pressure i have to look for type and value attibute. i guess there is no other solution than some coding. python? any suggestions?

As I said, look for an app that already does this. Here is an example: https://www.ericwolter.com/projects/apple-health-export/


I know nothing about the app or it's developer. Could be a scam. Doesn't look like one. Could be others.

Apr 29, 2023 8:55 AM in response to etresoft

when i download i get two files: export.xml and export_cda.xml. i’d like to import into excel but it doesn’t work.

excel gives you the option to import xml files.

i think it’s pretty obvious that one would like to import the data into a spreadsheet so i find it very strange it’s so hard.

i start to believe there is actually no interest from apple to support this cause they want you to stay inside the apple world

Apr 29, 2023 10:35 AM in response to ulrich265

ulrich265 wrote:

ok thanks. good idea. doesn’t help me a the moment though. is this sending bug reports ever helpful? or just lost in cyperspace …


Apple has already addressed a glitch found in XML Health data formatting in earliest iOS 16, based on a previous thread and the XML formatting work-around that was posted here. That bug was resolved in current iOS.


With what might happen with bug reports at Microsoft, I have rather less experience.


Most vendors will pay attention to high-quality bug reports, with details, and/or a concise reproducer, and/or diagnostics. Those same vendors will tend to defer or ignore the “it does not work” and “it broke” and “virus!!!” bug reports, absent a support contract or similar incentive. Bugs in deprecated features or arcane corners aside, that is. On iPhone, Health app is definitely getting active maintenance and updates, and is not deprecated.

Apr 29, 2023 2:53 PM in response to ulrich265

ulrich265 wrote:

when i download i get two files: export.xml and export_cda.xml. i’d like to import into excel but it doesn’t work.
excel gives you the option to import xml files.
i think it’s pretty obvious that one would like to import the data into a spreadsheet so i find it very strange it’s so hard.

It doesn't work that way. XML is not a format. It is a way of structuring data. The structure of this data is not directly compatible with the simple structure of a spreadsheet. I'm sure there are 3rd party apps and scripts that could perform the conversion, but I haven't looked for any.

i start to believe there is actually no interest from apple to support this cause they want you to stay inside the apple world

This would be equally true of Numbers. This kind of export is specifically so that 3rd party apps can use it. If Apple wanted to keep it within Apple, then there would be no export option at all.


Unfortunately, anything involving "health" is going to be a huge red flag for any halfway decent software developer. They will want to stay far, far away due the insane levels of regulation and litigation. Even Apple isn't immune to this. A medical devices company recently sued Apple over the oxygen sensor in the Apple Watch and won.


Unfortunately, that leaves end users without many options. You can look for some freebie apps or scripts written by developers who haven't reached that "halfway decent" level yet. I could do something like this in my sleep. I was the one for fixed the original XML export problems in iOS 16. It's quite simple. I was very surprised that Apple screwed up the export that badly. But there's no money it and only hassles. This is the way the world works these days. We can't have nice things. There are too many powerful people (not Apple) who will not allow it.

Apr 30, 2023 11:30 AM in response to etresoft

i just opened the file in some editor and i can see all the data now. unfortunately the is only root <healthdata> and child <record> and all the data saved in attributes. so e.g. if i want to get systolic blood pressure i have to look for type and value attibute. i guess there is no other solution than some coding. python? any suggestions?

May 1, 2023 1:04 AM in response to etresoft

thanks! that was really helpful! the app is not scam and works perfectly delivering a nice csv file i can open in excel. exactly what i was looking for. i love to do things myself even if it involves some coding but i guess not worth the effort. although i’d really like to know how to extract the data using the attributes … :-)

apple health data export does not work

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