- The goal is to extract the value of the “UnitTypeId” key from each entry within an object named “Unit.”
Description:
- The “Unit” object contains multiple entries, each identified by a unique number (e.g., “5028830” and “5028956”).
- Each entry has a sub-object called “@attributes,” which, in turn, contains various properties, one of which is “UnitTypeId.”
- The task is to dynamically iterate through all entries within “Unit” and extract the value associated with the “UnitTypeId” key in each entry.
You guys have any idea how I can achieve this?
"Unit": {
"5028830": {
"@attributes": {
"UnitNumber": "109-B",
"FloorPlanName": "QUARTO INDIVIDUAL PLUS (APTO 4 QUARTOS)",
"Availability": "Available",
"Status": "Vacant Ready (Available)",
"AvailableOn": "01/01/2020",
"FloorplanId": 1152636,
"UnitTypeId": 653872,
"PropertyUnitId": 5028830,
"PropertyId": 1311265,
"FloorId": 2676147,
"FloorNumber": "1",
"BuildingId": 88719,
"BuildingName": "A",
"OccupancyType": "Student",
"IsAffordable": "0",
"HasPricing": "1",
"WebVisible": "1"
}
},
"5028956": {
"@attributes": {
"UnitNumber": "409-B",
"FloorPlanName": "QUARTO INDIVIDUAL PLUS (APTO 4 QUARTOS)",
"Availability": "Available",
"Status": "Vacant Ready (Available)",
"AvailableOn": "01/01/2020",
"FloorplanId": 1152636,
"UnitTypeId": 653872,
"PropertyUnitId": 5028956,
"PropertyId": 1311265,
"FloorId": 2676153,
"FloorNumber": "4",
"BuildingId": 88719,
"BuildingName": "A",
"OccupancyType": "Student",
"IsAffordable": "0",
"HasPricing": "1",
"WebVisible": "1"
}
}
}