Json array builder - error handling

Im working with the json array builder and when i get an error message it is something like…

SyntaxError: Unexpected token , in JSON at position 645

great but it doesnt return the data to determine the issue. the array template is less than 645 so its impossible to determine where the real issue is.

Ideally it would return the full data with the VALs inserted and the error so you can see where the fault lies.

Hmm, I thought it was already doing that. I had the same problem before.

Will check.

Ah, I think I modified the “JSON Builder” module for that, but not “JSON Array Builder”.

Will make the same enhancement if needed and patch your system.

yeah the regular builder handles it correctly just not the array builder.

if you could add that, it would be great. trying to track down an issue that is escaping me

thanks

Have patched your system so the JSON Array Builder module will now emit the generated JSON when an error occurs in the assembly editor.

Reload the editor to get the patch.

seems to be working now but where it says i have an error i do not see an issue. it all seems to be formatted correctly.

I assume the error denotes character position not line/row, correct?

I think it is character position.

ok then i dont understand this error message. it says unexpected , but everything appears to be formatted correctly from what i can tell.

An error was reported by module [JSON Array Builder #16]:

Could not parse generated JSON [{
"ref": "093.ETVL.000002.NLK",
"from": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "Valentine",
"st": "NE",
"zip": "69201"
},
"to": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "North Platte",
"st": "NE",
"zip": "69103"
},
"chg": 0,
"line": 0,
"sale": 2,
"incl": false,
"tran": 1,
"serv": 27,
"dbt": false,
"adj": false,
"plsp": 0.5
},{
"ref": "093.ETVL.000004.NLK",
"from": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "Bassett",
"st": "NE",
"zip": "68714"
},
"to": {
"cnty": "null",
"ctry": "",
"int": true,
"city": "",
"st": "",
"zip": ""
},
"chg": 635,
"line": 1,
"sale": 2,
"incl": false,
"tran": 1,
"serv": 27,
"dbt": false,
"adj": false,
"plsp": 0.5
},{
"ref": "093.VPN.000005.NLK",
"from": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "Harrison",
"st": "NE",
"zip": "69346"
},
"to": {
"cnty": "null",
"ctry": "",
"int": true,
"city": "",
"st": "",
"zip": ""
},
"chg": 50,
"line": 2,
"sale": 2,
"incl": false,
"tran": 1,
"serv": 27,
"dbt": false,
"adj": false,
"plsp": 0.5
},{
"ref": "093.VPN.000006.NLK",
"from": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "Alliance",
"st": "NE",
"zip": "69301"
},
"to": {
"cnty": "null",
"ctry": "",
"int": true,
"city": "",
"st": "",
"zip": ""
},
"chg": 100,
"line": 3,
"sale": 2,
"incl": false,
"tran": 1,
"serv": 27,
"dbt": false,
"adj": false,
"plsp": 0.5
},{
"ref": "\/VLXP\/0000002273\/\/XNL\/",
"from": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "North Platte",
"st": "NE",
"zip": "69101"
},
"to": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "Valentine",
"st": "NE",
"zip": "69201"
},
"chg": 600,
"line": 4,
"sale": 2,
"incl": false,
"tran": 1,
"serv": 27,
"dbt": false,
"adj": false,
"plsp": 0.5
},{
"ref": "\/VLXP\/0000009648\/\/XNL\/",
"from": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "North Platte",
"st": "NE",
"zip": "69101"
},
"to": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "Lincoln",
"st": "NE",
"zip": "68521"
},
"chg": 100,
"line": 5,
"sale": 2,
"incl": false,
"tran": 1,
"serv": 27,
"dbt": false,
"adj": false,
"plsp": 0.5
},{
"ref": "093.VPN.002668.NLK",
"from": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "Keystone",
"st": "NE",
"zip": "69144"
},
"to": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "Arlington",
"st": "NE",
"zip": "68002"
},
"chg": 100,
"line": 6,
"sale": 2,
"incl": false,
"tran": 1,
"serv": 27,
"dbt": false,
"adj": false,
"plsp": 0.5
},{
"ref": "093.VPN.002752.NLK",
"from": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "Arthur",
"st": "NE",
"zip": "69121"
},
"to": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "Lincoln",
"st": "NE",
"zip": "68521"
},
"chg": 100,
"line": 7,
"sale": 2,
"incl": false,
"tran": 1,
"serv": 27,
"dbt": false,
"adj": false,
"plsp": 0.5
},{
"ref": "093.VPN.002753.NLK",
"from": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "Elsie",
"st": "NE",
"zip": "69133"
},
"to": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "Lincoln",
"st": "NE",
"zip": "68521"
},
"chg": 100,
"line": 8,
"sale": 2,
"incl": false,
"tran": 1,
"serv": 27,
"dbt": false,
"adj": false,
"plsp": 0.5
},{
"ref": "093.VPN.002754.NLK",
"from": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "Hyannis",
"st": "NE",
"zip": "69350"
},
"to": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "Lincoln",
"st": "NE",
"zip": "68521"
},
"chg": 100,
"line": 9,
"sale": 2,
"incl": false,
"tran": 1,
"serv": 27,
"dbt": false,
"adj": false,
"plsp": 0.5
},{
"ref": "\/VLXP\/0000007556\/\/XNL\/",
"from": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "Ogallala",
"st": "NE",
"zip": "69153"
},
"to": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "Lincoln",
"st": "NE",
"zip": "68521"
},
"chg": 100,
"line": 10,
"sale": 2,
"incl": false,
"tran": 1,
"serv": 27,
"dbt": false,
"adj": false,
"plsp": 0.5
},{
"ref": "\/VLXP\/0000007554\/\/XNL\/",
"from": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "Wauneta",
"st": "NE",
"zip": "69045"
},
"to": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "Lincoln",
"st": "NE",
"zip": "68521"
},
"chg": 100,
"line": 11,
"sale": 2,
"incl": false,
"tran": 1,
"serv": 27,
"dbt": false,
"adj": false,
"plsp": 0.5
},{
"ref": "\/VLXP\/0000007552\/\/XNL\/",
"from": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "Grant",
"st": "NE",
"zip": "69140"
},
"to": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "Lincoln",
"st": "NE",
"zip": "68521"
},
"chg": 100,
"line": 12,
"sale": 2,
"incl": false,
"tran": 1,
"serv": 27,
"dbt": false,
"adj": false,
"plsp": 0.5
},{
"ref": "093.ETVL.002557.NLK",
"from": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "York",
"st": "NE",
"zip": "68467"
},
"to": {
"cnty": "null",
"ctry": "United States",
"int": true,
"city": "Lincoln",
"st": "NE",
"zip": "68521"
},
"chg": 826,
"line": 13,
"sale": 2,
"incl": false,
"tran": 1,
"serv": 27,
"dbt": false,
"adj": false,
"plsp": 0.5
}]: SyntaxError: Unexpected token , in JSON at position 374

You can use an online JSON validator to better find the error. The Duck Duck Go search engine in particular will bring up an embedded validator when you search for “JSON validator”. It shows an error when I enter your JSON.

ok i will check it out. when i used jsonlint it said it was good.

Yeah. I tried a few different ones and as long as i remove the error message at the beginning and end, it says valid.

Last note, if I copy the JSON text from the error and put it in a data streams - create from text module, it works fine. just something about the builder module is reading a false error

I can help take a look, let me know the uuid of the assembly test case.

7536f38e37c543d08c9a985c3fe13440

to retrieve the proper invoice that it is pulling in you need to be using the nebraskalink-imp account.

thanks

The generated JSON contains an error, here:

isnt that the array separator? its needed there.

The module sends the generated JSON to the browser to be parsed for validation. It is highly unlikely the browser has a JSON validation flaw, plus the JSON tool in my screenshot shows the error.