I routinely export lists of metadata objects (e.g., data elements, orgunits) with the API. I used to be able to export an XLS file via the API, and I chose XLS because it would include special characters / accents. For example, the API would look like https://[url]/api/organisationUnits.xls.
However, that doesn’t work since we upgraded to 2.36 a while ago. Downloading CSV (API call looks like https://[url]/api/organisationUnits.csv) exports the metadata differently (for example, what should be “ç” returns as “ç”).
What workarounds are there? Is it still possible to export XLS files, but perhaps the API call changed?
Thank you! I can’t confirm if this works for accents / special characters since the list in this server doesn’t seem to have any. However, it seems to only work for 2.39 and 2.40. I get this error when trying for 2.38 and below.
Thank you for the info. If the same exact steps work in 2.39 and 2.40 but not 2.38, it is possible that a bug got fixed in later versions but not in 2.38, so would you like to create (using your Jira account) a Jira bug ticket with the steps to reproduce? Projects - Jira
We’ve closed the original JIRA ticket ([DHIS2-15784] - Jira) which evolved over time: it showed different characters in Excel importing CSV. After some discussions, Luigi came up with a workaround that I’m posting here for anyone also facing this:
It seems like it’s not as issue with format, it’s more of an issue of encoding. The default encoding of Excel is ANSII, not UTF-8. Accents appear correctly for UTF-8. One solution is to open Excel > click on Data > click Get Data > click From File > click From Text/CSV. After choosing the CSV file that exports from DHIS2 (which will have the corrupted text), the Excel import wizard appears, and then you can click UTF-8 and then click load.