Read json issue

Hi All,

[{“CustName”:“Lift Tours”,
“Comments”:“This customer is on credit hold.”}

Any idea how to parse the above json into a dictionary?

Thanks for your help

This is how you parse JSON into a dictionary.

But it will fail as the json you wrote isn’t valid json.

//If the json starts with {
Dim dic as xojo.core.dictionary =

//if the json starts with [
Dim dictionaries() as auto =

For each dic as xojo.Core.dictionary in dictionaries


json tutorial:

Thanks Guys,

The json is retrieved from a Rest application created using Openedge Developer (Progress), I can’t imagine that Progress is creating a wrong json.
What I want to do is read the data using a certain key value. I’m able to parse the json data into a data dictionary, but reading the dictionary is a bit frustrating.


In that case maybe you only pasted part of the JSON answer.

What really helps me analysing JSONdata is

Keep in mind that JSONdata can either be an array of dictionaries or a dictionary.
Each value can then contain a Text, Integer, Boolean, another dictionary or array of dictionaries.

Or Double or Nil.

Thanks guys for your ideas. I have been able to solve this matter.
By using the Advanced REST Client in chrome I was able to view the data in a different way. It showed me that my data is stored in a array of dictionaries. Also this tool showed me that the received json file was formatted correctly.
I also used the validator, as suggested by Jeremie, it showed me also a positive message in regards to the json format.