AnsweredAssumed Answered

How to create array indexes in json profile manually

Question asked by tejaswini on Sep 20, 2018
Latest reply on Sep 24, 2018 by tejaswini

I am trying to create a JSON profile which has array repeating elements but not sure on creating indexes manually in json profile.

 

Required format:
{"external_customer_id":"XXXX","type":"XX","event_id":"XX","sub_channel_detail":"XX","value":"XX","products":{"0":{"product_id":"XX-X","price":"X","quantity":"X","custom_attributes":{"retail_value":"X","product_coupons":{"0":{"code":"xxx"}}}},"1":{"product_id":"xxx-x","price":"x","quantity":"x","custom_attributes":{"retail_value":"xxx","product_coupons":{"0":{"code":"xxx"}}}},"2":{"product_id":"xxx","price":"xx","quantity":"xx","custom_attributes":{"retail_value":"xxx","product_coupons":{"0":{"code":"xxx"}}}},"3":{"product_id":"xxx","price":"10","quantity":"xxx","custom_attributes":{"retail_value":"xxx","product_coupons":{"0":{"code":"xxx"}}}},"tenders":{"0":{"name":"Cash","value":"xxx"},"1":{"name":"xxxx","value":"xxx"}}}

 

 

 

 

Format Created Manually :
{
"external_customer_id" : "XXXXXX",
"type" : "XXXXXX",
"event_id" : "XXXXXXXXXX",
"value" : "XXX",
"products" : [
{
"product_id" : "XXXXXXXX",
"price" : "XXXXXXX",
"quantity" : "XXXXXXXX",
"custom_attributes" : {
"retail_value" : "XXX",
"product_coupons" : {
"code" : [
"XXXXXX"
]
}
}
},
{
"product_id" : "XXXXXXXX",
"price" : "XXXXXXXX",
"quantity" : "XXXXXXXX",
"custom_attributes" : {
"retail_value" : "XXXXXX",
"product_coupons" : {
"code" : [
"XXXX",
"XXXX"
]
}


Not able to create indexes 0like 0, 1 ,2 ,3.....
Kindly help with a solution

 

Thank you.

Outcomes