Convert this:
{\"items\":[{\"id\":\"BLE89-A0-123-384\",\"weight\":\"100\",\"quantity\":3}, ... {\"id\":\"BLE10-A0-123-321\",\"weight\":\"
You need to do the following:
var newJSON = {}; for (var i = 0; i < oldJSON.items.length; i++) { newJSON[oldJSON.items[i].id] = oldJSON.items[i].quantity; }