Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
jelindbe
Partner - Contributor III
Partner - Contributor III

JSON parsing problem

I try to parse JSON code formatted like this:

[ { "nsrId": "1020895", "koordinatLatLng": [ 59.7626, 10.03038 ], "navn": "Stenseth barnehage", "fylkesnummer": "06", "kommunenummer": "0625", "alder": "1 - 5", "eierform": "Privat", "antallBarn": 77 },.........

My Rest connection generates this code:

----------------------

RestConnectorMasterTable:

SQL SELECT

"nsrId",

"navn",

"fylkesnummer",

"kommunenummer",

"alder",

"eierform",

"antallBarn",

"__KEY_root",

(SELECT

"@Value",

"__FK_koordinatLatLng"

FROM "koordinatLatLng" FK "__FK_koordinatLatLng" ArrayValueAlias "@Value")

FROM JSON (wrap on) "root" PK "__KEY_root";

[koordinatLatLng]:

LOAD [@Value] AS [Lat],

[__FK_koordinatLatLng] AS [__KEY_root]

RESIDENT RestConnectorMasterTable

WHERE NOT IsNull([__FK_koordinatLatLng]);

[root]:

LOAD [nsrId] AS [nsrId],

[navn] AS [Barnehage],

[kommunenummer] AS [Kommunenummer],

[alder] AS [Aldersspenn],

[eierform] AS [Eierform],

[antallBarn] AS [Antall barn],

[__KEY_root] AS [__KEY_root]

RESIDENT RestConnectorMasterTable

WHERE NOT IsNull([__KEY_root]);

DROP TABLE RestConnectorMasterTable;

------------------------------

My problem is that latitude/longitude ("koordinatLatLng": [ 59.7626, 10.03038 ]) is read like a sum. I need to read latitude and longitude as separate entities but I cannot figure out how to change the code to accomplish that.
2 Replies
marcus_sommer

I think this will be helpful for you: Re: Parsing JSON data with loop

- Marcus

jelindbe
Partner - Contributor III
Partner - Contributor III
Author

Thank you for your contribution Marcus. However, I am not a developer and could not figure out any solution. I guess I must wait until our overloaded developer team can help me.