Link to home
Start Free TrialLog in
Avatar of stargateatlantis
stargateatlantis

asked on

Advanced json just need the record object block

Lets say I have the following JSON OBJECT

{
    "teamname": "Anaheim Ducks",
    "nickname": "Ducks",
    "SportTypes": {
      "-JZLOh7KtM78I5wAL6Ua": true
    },
    "locations": {
      "-JZLCFtpcuvsYxb5N1Cc": true
    },
    "countries": {
      "-JZG9IwEwKGqsExky7UT": true
    },
    "leagues": {
      "-JZLd1hXyyr9ehLwmmbc": true
    },
    "Divisions": {
      "-JZLh2UYKi5IvphLtX4I": true,
      "-JZLh2UaZbpcO7XixD1x": true
    }
  }

Open in new window



I want to loop thru it and pull the record chunks so if the loop pointer position is at 0 all the following JSON chunk will be stored in a variable.

{
    "teamname": "Anaheim Ducks",
    "nickname": "Ducks",
    "SportTypes": {
      "-JZLOh7KtM78I5wAL6Ua": true
    },
    "locations": {
      "-JZLCFtpcuvsYxb5N1Cc": true
    },
    "countries": {
      "-JZG9IwEwKGqsExky7UT": true
    },
    "leagues": {
      "-JZLd1hXyyr9ehLwmmbc": true
    },
    "Divisions": {
      "-JZLh2UYKi5IvphLtX4I": true,
      "-JZLh2UaZbpcO7XixD1x": true
    }
  }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Rob
Rob
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial