LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
0 Kudos
hlcfreelook

Parse JSON value, nested object or array as string

Status: Already Implemented

Available in LabVIEW 2019 and later. Go to the Functions > Programming > String > Flatten/Unflatten String palette and select the item to download and install the JSONtext Toolkit for LabVIEW.

Using LabVIEW primitive Unflatten From JSON, we need to know the precise structure of the JSON input to access a specific value.

However sometimes we don't have the precise sturcture of the JSON input beforehand, sometimes the structure is heavily nested.

It will be very useful to parse JSON value, nested object or array as string, so that we can observe it or leave further parsing to a latter stage.

e.g. {"a":{"b":[{"c":"c"},{"d":FALSE},{"e":[1,2,3]}]}}

the structrue of value of "a" is a little complicated and I'd like it to be parsed into a string first. It would be very convinient if we can have cascaded parsings as shown below.

 

capture.PNG

 

6 Comments
AristosQueue (NI)
NI Employee (retired)

Please check out LabVIEW 2019, which includes the JSON Toolkit. If you need the toolkit in an earlier version of LabVIEW, you can install it from here:

https://forums.ni.com/t5/JSON-Toolkit-for-LabVIEW/gp-p/8520

 

Darren
Proven Zealot
Status changed to: Already Implemented

Available in LabVIEW 2019 and later. Go to the Functions > Programming > String > Flatten/Unflatten String palette and select the item to download and install the JSONtext Toolkit for LabVIEW.

hlcfreelook
Member

Thanks Darren for point out the implementation, though here comes another problem.

After upgraded to 2019, the JSONtext adds-on indicator showed up. But while installing the adds-on by VI Package Manager, I got this message and the process stopped.

I'm using LabVIEW 2019 (32-bit) on Windows 10 Home Edition.

 

capture.PNG

drjdpowell
Trusted Enthusiast

Can you try opening VIPM as "run as administrator" and then install JSONtext from there? 

hlcfreelook
Member

Tried running as administrator, failure again. I even tried to installed earily versions of JSONtext, same result.

I'm using LabVIEW 2019 (32-bit) on Windows 10 Home Edition (64-bit based on x64 processors).

 

capture.PNG

wiebe@CARYA
Knight of NI