0

I have along and complicated JSON tree structure. Instead of looping and traversing the JSON tree in the file was wondering if there is an easier method of achieving the same result.

I have the following (posting small part of json file)

Section of JSON file showing structure

I want to append the file at the position of the arrow in the pic.

    let newSectorDistributionComponent =  {
    "elementProperties": {
        "key": "specific sector",
        "label": "sector",
        "visible": false
    }
};

I have already tried other page on SO including: JSON javascript-objects-get-parentnested-javascript-object

Afshin Ghazi
  • 2,784
  • 4
  • 23
  • 37
  • 1
    Why don't the answers you've linked work for you? They seem to contain everything you'd need to solve this as far as I can tell. You may need to expand your question if there's a reason the other questions are not viable solutions. – DBS Apr 10 '18 at 13:54
  • I’m not sure I understand what you are trying to do and what the problem or question is? – jcaron Apr 10 '18 at 13:57
  • well... you cannot insert anything in a specific place, without traversing at least a part of your file. Your links contain exactly what you need for achieving that, or did I not get your question? – Iamnino Apr 10 '18 at 14:09

0 Answers0