My Json object contains 4 children: Item, Column 1, Column 2, and Column 3.
{
Item: {0: "PD", 1: "1 - Processor Intel Xeon E5-2630", 2: "2 - Additional
Processor", 3: "3 - Memory Quantity Increase", 4: "4 - Raid 6 H730/H730p Cabled Chassis", 5: "5 - Hard Drive Quantity Increase", 6: "6 - Perc H730 Raid Controller 1GB", 7: "7 - UEFI BIOS Boot", 8: "8 - Support: ProDeploy", 9: "9 - Hard Drive Support 3 years", 10: "10 - Dell Networking N2024P Switch", 11: "11 - N2024P Switch - 5 Years Support", 12: "12 - N2024P Switch - Pro Deployment L2 N"},
Column 1: {0: 0.2, 1: 0.64, 2: 0.67, 3: 0.63, 4: 0.65, 5: 0.74, 6: 0.64, 7: 0.65, 8: 0.63, 9: 0.65, 10: 1.02, 11: 0.71, 12: 0.7},
Column 2: {0: 0.24, 1: 0.7, 2: 0.69, 3: 0.7, 4: 0.69, 5: 0.79, 6: 0.69, 7: 0.68, 8: 0.67, 9: 0.68, 10: 1.05, 11: 0.74, 12: 0.72},
Column 3: {0: 0.199, 1: 0.665, 2: 0.652, 3: 0.631, 4: 0.644, 5: 0.698, 6: 0.647, 7: 0.637, 8: 0.622, 9: 0.63, 10: 0.997, 11: 0.698, 12: 0.672}
}
I'm looking to extract the column name (object name) and access the th element for all objects during an orchestrate mode operation. For example:
Item: PD | Column 1: 0.2 | Column 2: 0.24 | Column 3: 0.199
Item: 1 - Processor Intel Xeon E5-2630 | Column 1: 0.64 | Column 2: 0.7 | Column 3: 0.665
Note that the names of Column 1, Column 2, and Column 3 are dynamic and can vary when creating this jSon object.
Additional Information:
Using Javascript, I attempted to loop through the first object and fetch the corresponding position cell values for other objects. However, due to the dynamic nature of object names, I am unsure how to proceed.
i = 0
for (column in dfJson){
if(i == 0){
for (item in column){
console.log(dfJson['Item'][dfJson[obj][item]]); //here I have the value for the first object "Item" in this iteration
//I need to retrieve the value for Column 1 in the same position
//I need to retrieve the value for Column 2 in the same position
//I need to retrieve the value for Column 3 in the same position
}i++;}}