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.

2
  • Try looking here Commented Oct 14, 2014 at 4:10
  • Thanks @borrrden, I have checked out that post before. Very informative, a good education for me. Commented Oct 14, 2014 at 11:20

1 Answer 1

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.. :)

Sign up to request clarification or add additional context in comments.

2 Comments

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.
@nlabhart> Nice to hear that... :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.