Hi I am trying to make below Raw JSON as key-value. I am not sure what to use for "Children as it has nested array parameters
“Type”:“software.type”,
“PropertyNames”:[“Name”,“PartitionID”],
“Propertyvalues”:[“CKCle”,“1234”],
“Children”:[
{
"Type":test",
"PropertyNames":["personal","clarence"],
"Propertvalues":["209","112"]}
]
}
is what i have below is correct?
**Key value**
Children.type test
Children.PropertyNames[] Name
Children.PropertyNames[] PartitionID
Children.Propertvalues[] 209
Children.Propertvalues[] 112
bpricilla
(Pricilla B)
December 14, 2020, 4:59am
2
@mkuriakose2000 Welcome to the Community
Since “Children” has nexted arrays, just that you need to add the index along.
Children[0].Type
Also please provide the complete JSON and what’s the idea behind taking key-value for JSON? Are you trying to reach out to the individual objects?
1 Like
Hi Thank you for the reply, full JSON is like below. I have only 2 arrays inside the child object (PropertyNames and Propertvalues) that needs to be represented as key-value and I am not sure of it
“Type”:“software.type”,
“PropertyNames”:[“Name”,“PartitionID”],
“Propertyvalues”:[“CKCle”,“1234”],
“Children”:[
{
“Type”:TestChildrenType",
“PropertyNames”:[“personal”,“clarence”],
“Propertvalues”:[“209”,“112”]}
]
}
I need to convert this JSON to key-value because I am developing a REST call that only understands Key value. I want to do some test with this, REST call is not working so I think I am using a wrong format currently
I am planning to use key-value as below
Type -----------------------------------> software.type
PropertyNames[ ] -----------------------------------> Name
PropertyNames[ ] ------------------------------------> PartitionID
Propertyvalues[ ] -------------------------------------> testName
Propertyvalues[ ] -------------------------------------> testPartitionID
Children[ ].Type -------------------------------------> TestChildrenType
Children[ ].PropertyNames[ ] ------------------------------------> personal
Children[ ].PropertyNames[ ] ------------------------------------> clarence
Children[ ].Propertvalues[ ] ------------------------------------> 209
Children[ ].Propertvalues[ ] ------------------------------------> 112
Do you think above format is correct? please let me know
bpricilla
(Pricilla B)
December 14, 2020, 6:13am
4
@mkuriakose2000 , Its almost correct. Please add index whenever you are accessing nested arrays
Type -----------------------------------> software.type
PropertyNames[0 ] -----------------------------------> Name
PropertyNames[1 ] ------------------------------------> PartitionID
Propertyvalues[0 ] -------------------------------------> CKCle
Propertyvalues[1] -------------------------------------> 1234
Children[0 ].Type -------------------------------------> TestChildrenType
Children[0 ].PropertyNames[0 ] ------------------------------------> personal
Children[ 0].PropertyNames[1 ] ------------------------------------> clarence
Children[0 ].Propertvalues[0 ] ------------------------------------> 209
Children[ 0].Propertvalues[ 1] ------------------------------------> 112
Please try if this works
Thank you I think its working now
1 Like
bpricilla
(Pricilla B)
December 14, 2020, 6:31am
6
@mkuriakose2000 Great to hear Have a good day…