Hello Guys,
I am currently creating a simple REST Web Service using NetTalk.
I have created a request that will send this response formatted on JSON for example:
{ "shoppingcart_response": { "shopcarthdr": [ { "cartid": "2105218IEG1HYJ", "userid": "", "sellerid": "2008196195", "street": "29 Jump Street", "entrytype": "O", "receivername": "Juan Dela Cruz", "contactno": "n/a", "emailaddress": "[email protected]", "cartstatus": "X", "shopcartdtl": [ { "cartid": "2105218IEG1HYJ", "sellerid": "2008196195", "productcode": "FAST000003", "productprice": 11.5, "taxcode": 0, "qty": 200, "detailtype": "" }, { "cartid": "2105218IEG1HYJ", "sellerid": "2008196195", "productcode": "Z_DELIVERYCHARGE", "productprice": 0, "taxcode": 0, "qty": 1, "detailtype": "D" } ] }, { "cartid": "210521DRVF9Q5O", "userid": "", "sellerid": "2008196195", "street": "29 Jump Street", "entrytype": "O", "receivername": "Juan Dela Cruz", "contactno": "n/a", "emailaddress": "[email protected]", "cartstatus": "X", "shopcartdtl": [ { "cartid": "210521DRVF9Q5O", "sellerid": "2008196195", "productcode": "EGSCIBREAD013", "productprice": 20, "taxcode": 0, "qty": 5, "detailtype": "" }, { "cartid": "210521DRVF9Q5O", "sellerid": "2008196195", "productcode": "EGSCIBREAD014", "productprice": 20, "taxcode": 0, "qty": 3, "detailtype": "" }, { "cartid": "210521DRVF9Q5O", "sellerid": "2008196195", "productcode": "EGSCIEGG001", "productprice": 195, "taxcode": 0, "qty": 1, "detailtype": "" }, { "cartid": "210521DRVF9Q5O", "sellerid": "2008196195", "productcode": "EGSCIMEAT00011", "productprice": 75, "taxcode": 0, "qty": 1, "detailtype": "" }, { "cartid": "210521DRVF9Q5O", "sellerid": "2008196195", "productcode": "FAST000002", "productprice": 23, "taxcode": 1, "qty": 1, "detailtype": "" }, { "cartid": "210521DRVF9Q5O", "sellerid": "2008196195", "productcode": "SARANGANI2600", "productprice": 212.8, "taxcode": 0, "qty": 1, "detailtype": "" }, { "cartid": "210521DRVF9Q5O", "sellerid": "2008196195", "productcode": "Z_DELIVERYCHARGE", "productprice": 0, "taxcode": 0, "qty": 1, "detailtype": "D" } ] }, { "cartid": "210521YGWLKGG6", "userid": "", "sellerid": "2008196195", "street": "905 Aurora Blvd. Cor. Harvard", "entrytype": "O", "receivername": "Juan Dela Cruz", "contactno": "n/a", "emailaddress": "[email protected]", "cartstatus": "X", "shopcartdtl": [ { "cartid": "210521YGWLKGG6", "sellerid": "2008196195", "productcode": "SUYHSUR13", "productprice": 87, "taxcode": 1, "qty": 2, "detailtype": "" }, { "cartid": "210521YGWLKGG6", "sellerid": "2008196195", "productcode": "Z_DELIVERYCHARGE", "productprice": 0, "taxcode": 1, "qty": 1, "detailtype": "D" } ] } ], "skippedrecords": "0", "resultcomplete": "1" } }
Based on the JSON response above, I have created a nested json structure, using shopcarthdr
(as parent), and shopcartdtl
(as child).
On the Client part(API Requester App that I created):
What I want to achieve is to load the shopcartdtl
(child JSON values) to a separate table (topspeed file) since loading the header JSON to a file structure can be achieved using the load function from jFiles.
I already read jFiles document regarding loading nested JSON but I am confused with the explanation from the document.
Can someone help me in that?
Thanks in advanced.