Best structure for extracting data from JSON

I have an application in which the user makes a number of adjustments to parameters and produces a JSON structure that looks like this:

		"Capture One" : {
			"Cost" : {
				"ParameterScore" : "75",
				"PersonalValue" : "80"
			},
			"Compatibility with raw files" : {
				"ParameterScore" : "25",
				"PersonalValue" : "75"
			},
			"Purchase model" : {
				"ParameterScore" : "25",
				"PersonalValue" : "60"
			},
			"Candidate Value" : "56.66667"
		}

There is a chunk like this for each candidate. I want to be able to pick out which candidate (“Capture One” is one candidate) has the highest candidate value (in this case “56.66667” (converted to a double)). There is no obvious way to do this with just JSON manipulation, so I tried making a Dictionary using the candidate name as a key and the candidate value as a value. I can make a Keys array from the Dictionary but it’s an array of Variants, and I’m having trouble getting a number out of this that I can manipulate.

I’m beginning to wonder whether it was a mistake to look at Dictionaries. Is there another way in which I can take a JSON document and extract strings and numbers that allows me to compare the numbers?

It’s possible that I’m so close to this that I’m missing the obvious, but in any case I’d appreciate some advice.

Thanks,

Ian.

Here’s an example project that should get you started down the right path.
json_candidate_compare.xojo_binary_project.zip (4.7 KB)

Thanks, I will take a look.

OK, I’ve had a look at the example project. I can see that it uses JSONItem (I’m using the Einhugur JSONNode plugin), but it has pointed me in the right direction, I think.

Thanks for the quick response.