ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

JSON conversion

Solved!
Go to solution

{"channel":{"id":720151,"name":"Power Monitoring System","latitude":"0.0","longitude":"0.0","field1":"Voltage","created_at":"2019-03-05T10:24:13Z","updated_at":"2019-03-05T10:24:13Z","last_entry_id":523},"feeds":[{"created_at":"2019-03-07T11:16:17Z","entry_id":523,"field1":"056"}]}

 

Hello friends,

I'm trying Unflattering from JSON , i dont know how to get the data from it, i need the value of "field1" please kindly suggest a method or send me the VI.

Thanks, 

 

0 Kudos
Message 1 of 8
(5,021 Views)

Hi Rao,

 

i need the value of "field1" please kindly suggest a method

A very simple way:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 8
(5,006 Views)

Hi,

 

what about 'unflatten from JSON' in the String Function Palette??

Function>Programming>String>Flatten/Unflatten String>...

 

Regards

Kay

Message 3 of 8
(5,002 Views)

value of field1 is 56

so i need to extract the value of field1 from JSON file

0 Kudos
Message 4 of 8
(4,990 Views)
Solution
Accepted by topic author MrRao

Try using JSONtext.

JSONtext example.png

Message 5 of 8
(4,972 Views)

it worked , 

Thank You for suggesting the addon , its simple to build..

 

0 Kudos
Message 6 of 8
(4,962 Views)

What's wrong with the inbuilt LabVIEW JSON parser?  Do you really need a plugin for such a simple operation?

JSONfield1.png

Troy - CLD "If a hammer is the only tool you have, everything starts to look like a nail." ~ Maslow/Kaplan - Law of the instrument
0 Kudos
Message 7 of 8
(4,901 Views)

@TroyK wrote:

What's wrong with the inbuilt LabVIEW JSON parser?  Do you really need a plugin for such a simple operation

 


For the very simplest example, no, but the complexity of using the inbuilt parser grows rapidly with only slightly less simple real world problems.  

Message 8 of 8
(4,855 Views)