Error: Unexpected character ('P' (code 80))

Hi all,

DHIS 2 version: 2.36.4

I have built an event program in the DHIS 2 but the json file for importing event data is not working and is giving error. I am wondering if anyone could help me to identify the problem. On demo it is not working either and I am sure the problem is with the file:

Json file

event import Json dhis 2 - NV.json (539 Bytes)

Error when importing

Please advise.

Thanks

Hernandez,

I looked at your file, and the problem does appear to be there. It isn’t easy to see the problem while looking at it visually, but some of the " characters are actually a different character. If you fix those, then the file should work.

Here is a version that I fixed. But, you’ll need to make sure that the correct quote character is used throughout your files.

event import Json dhis 2 - NV - fixed.json (497 Bytes)

Dan.

1 Like

Hi @ddaley,

Now I get a different error:

The event program name that is the file is correct but it is giving error.

Thanks

Run your json file against the json validators. There are a lot of errors. I would recommend you to create few events using Capture App and then export the Events to json format and have a look how it supposed to be created/structured. Seems like you manually created this json file and expecting it to work but its not.

1 Like