LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Add object into JSON file

Solved!
Go to solution

Hello,

 

Maybe it looks like a silly question, but I have just started to work with JSON files (I have never worked with them before). I'm trying to add an object (I don't know if this is the correct term) into a JSON file already created, but the new object replaces all the others of the same item.

panel & diagram.png

0 Kudos
Message 1 of 3
(1,650 Views)
Solution
Accepted by topic author vicens

You could get the array elements and concatenate like this:

2020-09-23 11_45_22-Add data to JSON.vi Block Diagram _.png

 

Message 2 of 3
(1,616 Views)

Note: in the latest available versions of JSONtext, one can use [#] to indicate a point at the end of an array for insertion, so one can directly insert using the path "$.users[#]".

 

2021-02-24 15_47_49-Window.png

 

Message 3 of 3
(1,371 Views)