Noob here, Can anyone please help me convert this Object which I am receiving in API Call to an array as mentioned below, also this Object will be dynamic i.e. record length can change. Thanks in advance.
myObject = {
"records": [{
"id": "recDBqsW7C3Dk3HMd",
"fields": {
"Latitude": "24.898907",
"Longitude": "67.117303",
"CustomerName": "Asad"
},
"createdTime": "2020-10-07T04:43:31.000Z"
},
{
"id": "recGlfTbUcEvP46Lf",
"fields": {
"Latitude": "24.907641",
"Longitude": "67.1088035",
"CustomerName": "Umar"
},
"createdTime": "2020-10-07T04:44:11.000Z"
},
{
"id": "recfsQsoznDyWPDe8",
"fields": {
"Latitude": "24.911112",
"Longitude": "67.105117",
"CustomerName": "Ali"
},
"createdTime": "2020-10-06T09:11:05.000Z"
}
]
};
To something like:
myArray = [{
"lat": 24.898907,
"lon": 67.117303,
"name": "Asad"
},
{
"lat": 24.907641,
"lon": 67.1088035,
"name": "Umar"
},
{
"lat": 24.911112,
"lon": 67.105117,
"name": "Ali"
}
]