dahlin Posted June 28, 2017 Report Share Posted June 28, 2017 Hi, I am using the JSON API to extract values from a string. I got the extracted string value out [0] as expected but when I try to read out the Boolean value I got an error (Not a JSON Scalar: 'null' ). /dahlin Quote Link to comment
Tim_S Posted June 28, 2017 Report Share Posted June 28, 2017 I believe you want to wire the Get:Boolean to the output of the Get:from JSON rather than the Get:sub-Item with the way you have the name array wired. The error is correct in that there is no Boolean in the JSON from the Get:sub-Item. A Boolean value in the JSON would be something like: "MaximizeOnStart": false I expect a value of [0] indicates a NULL rather than a logical 0. Quote Link to comment
dahlin Posted June 28, 2017 Author Report Share Posted June 28, 2017 Hi Tim, I tried to change the file input to 'false' instead of '0' and rewire the other wire that you pointed out but it is still the same problem. When probing the JSON wire it says it is a JSON Object.lvclass ? instead of Scalar? Quote Link to comment
Tim_S Posted June 28, 2017 Report Share Posted June 28, 2017 I would expect the sub-Item to be a scalar and the input to the Get:Boolean to be a JSON object. What does your JSON file look like? I would expect it to be something like below. { "blemishResults": { "passfail": { "Blemishes_all_passed": false } } } JSON test.vi 1 Quote Link to comment
dahlin Posted June 28, 2017 Author Report Share Posted June 28, 2017 OK, when I compared to your JSON file I found the problem: I had written true or false with brackets like this [true] [false]. Thank you Tim! /dahlin Quote Link to comment
JKSH Posted June 29, 2017 Report Share Posted June 29, 2017 4 hours ago, dahlin said: OK, when I compared to your JSON file I found the problem: I had written true or false with brackets like this [true] [false]. In JSON, square brackets represent arrays. So, this is an array that contains one Boolean element: [true] This is an array containing three Boolean elements: [true, false, true] Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.