3

I am trying to import some JSON data into one of my tables in Parse.com. When doing so, I get the following error:

Import encountered the following error: error 111: invalid type for key startDate, expected date, but got string

The data is below:

[
  {
    "title":"Software Webinar",
    "location":"Kingsview Financial",
    "host":"Josh Chase",
    "startDate":"10/13/2014 12:30",
    "EndDate":"10/13/2014 13:30",
    "eventType":"TA",
    "eventDescrioption":"Informative webinars on utilize and maximize all the features of the TA Trader platform."
  }
]

I've tinkered with the date format a bit but to no avail. Just trying to import some data, and have to use JSON data to do so. Thanks for any help.

rici
  • 234,347
  • 28
  • 237
  • 341
Noah Labhart
  • 157
  • 4
  • 18

1 Answers1

4

Formate your date like this:

"startDate": {

    "__type": "Date",
    "iso": "2014-10-13T12:30:00.000Z"
}

You JSON will look something like this:

[
  {
    "title":"Software Webinar",
    "location":"Kingsview Financial",
    "host":"Josh Chase",
    "startDate": {

        "__type": "Date",
        "iso": "2014-10-13T12:30:00.000Z"
    },
    "EndDate": {

        "__type": "Date",
        "iso": "2014-10-13T13:30:00.000Z"
    },
    "eventType":"TA",
    "eventDescrioption":"Informative webinars on utilize and maximize all the features of the TA Trader platform."
  }
]

Hope this helps.. :)

Rashad
  • 11,057
  • 4
  • 45
  • 73
  • Thanks @Rashad. I think this worked. Now I'm running into a different error, having to do with "file not containing data or is improperly formatted". I assume this means that I am passed the date issue. Update: fixed that, just needed to wrap my JSON in a { "results": [] } item. – Noah Labhart Oct 14 '14 at 11:20
  • @nlabhart> Nice to hear that... :) – Rashad Oct 15 '14 at 01:49