Ad Widget

Collapse

Got a JSON with names and values... how should I proceed??

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tharok
    Junior Member
    • Jun 2021
    • 4

    #1

    Got a JSON with names and values... how should I proceed??

    Hey guys! Sorry for bothering but I'm completely blocked with this one... I have a little script that returns me some JSON lines like this:

    {
    "data": [
    { "state": 4, "name": "Backup 1"},
    { "state": 4, "name": "Backup 2"},
    { "state": 2, "name": "Backup 3"},
    { "state": 4, "name": "Backup 4"}
    ]
    }

    The thing is... I though I could extract every "Backup" item and assign the "state" value to it, but I'm going crazy with LLD and item prototypes and can't get it properly... I though I could create a "parent" item that receives all the JSON and then create dependant items and crop the desired state, but can't see it completely clear... Any help??
Working...