Resolved Json Parser
- How-to
- SHAMEEM KAKKAD
- PowerBuilder
- Tuesday, 21 February 2023 07:02 AM UTC
Hi All,
While I am taking datas from my Json.. Getting wrong result... Anybody can help ?
Jpar = create jsonparser
Jpar.LoadFile('D:\aa.txt')
rootobj_ = Jpar.GetRootItem()
data_ = Jpar.GetItemObject (rootobj_, "data") geting result = 2
idd = Jpar.GetItemArray (data_, "sales_orders") geting result = 3
child = Jpar.GetChildCount(idd) geting result = 2
do while x_ <= child
id = Jpar.GetItemNumber (Jpar.GetChildItem(idd, x_), "id")
salesdetails = Jpar.GetChildItem (idd,x_) geting result = 4
saleddetailsid = Jpar.GetItemArray (salesdetails, "sales_order_details" ) geting result = 5
I don't know what is the mistake with me
Below my Json..........
{"status":true,"data":{"sales_orders":[{"id":1155,"client_id":40,"order_type":"","type":"O","order_no":"1","user_id":47,"order_status":"pending","date":"2023-02-21 00:00:00","salesman":"SHAMEER","narration":"","dod":"0000-00-00","customer_code":"13847","customer_name":"GARDEN CITY SUPERMARKET","address1":"Hedge Nagar","address2":"","latitude":"13.0389769","longitude":"77.6541024","location":"(13.0389769, 77.6541024)","invoice_path":"","device_id":"4608fce2bcce875f","cancelled_date":null,"version":1,"status":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z","sales_order_details":[{"id":5618,"sales_order_id":1155,"client_id":40,"product_code":"A0001","quantity":"1.0","price":"377.000","unit":"KG","barcode":"002365","tax_amount":"","remark":"","entry_rate":"29.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5619,"sales_order_id":1155,"client_id":40,"product_code":"A0002","quantity":"1.0","price":"377.000","unit":"KG","barcode":"002453","tax_amount":"","remark":"","entry_rate":"58.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5620,"sales_order_id":1155,"client_id":40,"product_code":"A0003","quantity":"1.0","price":"377.000","unit":"KG","barcode":"002454","tax_amount":"","remark":"","entry_rate":"116.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5621,"sales_order_id":1155,"client_id":40,"product_code":"A0004","quantity":"1.0","price":"377.000","unit":"KG","barcode":"002368","tax_amount":"","remark":"","entry_rate":"145.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5622,"sales_order_id":1155,"client_id":40,"product_code":"A0010","quantity":"1.0","price":"780.000","unit":"KG","barcode":"002811","tax_amount":"","remark":"","entry_rate":"60.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5623,"sales_order_id":1155,"client_id":40,"product_code":"A0012","quantity":"2.0","price":"780.000","unit":"KG","barcode":"002790","tax_amount":"","remark":"","entry_rate":"240.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5624,"sales_order_id":1155,"client_id":40,"product_code":"A0013","quantity":"2.0","price":"780.000","unit":"KG","barcode":"002814","tax_amount":"","remark":"","entry_rate":"300.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5625,"sales_order_id":1155,"client_id":40,"product_code":"A0017","quantity":"2.0","price":"1040.000","unit":"KG","barcode":"002430","tax_amount":"","remark":"","entry_rate":"320.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5626,"sales_order_id":1155,"client_id":40,"product_code":"A0018","quantity":"1.0","price":"1040.000","unit":"KG","barcode":"002265","tax_amount":"","remark":"","entry_rate":"400.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5627,"sales_order_id":1155,"client_id":40,"product_code":"A0021","quantity":"1.0","price":"980.000","unit":"KG","barcode":"002451","tax_amount":"","remark":"","entry_rate":"151.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5628,"sales_order_id":1155,"client_id":40,"product_code":"A0022","quantity":"2.0","price":"980.000","unit":"KG","barcode":"002364","tax_amount":"","remark":"","entry_rate":"302.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5629,"sales_order_id":1155,"client_id":40,"product_code":"A0023","quantity":"1.0","price":"980.000","unit":"KG","barcode":"002452","tax_amount":"","remark":"","entry_rate":"378.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5630,"sales_order_id":1155,"client_id":40,"product_code":"A0024","quantity":"1.0","price":"1495.000","unit":"KG","barcode":"002468","tax_amount":"","remark":"","entry_rate":"230.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5631,"sales_order_id":1155,"client_id":40,"product_code":"A0026","quantity":"1.0","price":"1495.000","unit":"KG","barcode":"002470","tax_amount":"","remark":"","entry_rate":"575.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5632,"sales_order_id":1155,"client_id":40,"product_code":"A0030","quantity":"2.0","price":"1500.000","unit":"KG","barcode":"001822","tax_amount":"","remark":"","entry_rate":"578.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5633,"sales_order_id":1155,"client_id":40,"product_code":"A0034","quantity":"1.0","price":"1287.000","unit":"KG","barcode":"002945","tax_amount":"","remark":"","entry_rate":"396.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5634,"sales_order_id":1155,"client_id":40,"product_code":"A0035","quantity":"1.0","price":"1287.000","unit":"KG","barcode":"002946","tax_amount":"","remark":"","entry_rate":"495.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5635,"sales_order_id":1155,"client_id":40,"product_code":"A0053","quantity":".5","price":"1066.000","unit":"KG","barcode":"09777","tax_amount":"","remark":"","entry_rate":"164.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5636,"sales_order_id":1155,"client_id":40,"product_code":"A0101","quantity":".5","price":"480.000","unit":"KG","barcode":"002386","tax_amount":"","remark":"","entry_rate":"20.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5637,"sales_order_id":1155,"client_id":40,"product_code":"A0102","quantity":".5","price":"480.000","unit":"KG","barcode":"002387","tax_amount":"","remark":"","entry_rate":"40.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5638,"sales_order_id":1155,"client_id":40,"product_code":"A0104","quantity":".5","price":"2280.000","unit":"KG","barcode":"09662","tax_amount":"","remark":"","entry_rate":"38.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5639,"sales_order_id":1155,"client_id":40,"product_code":"A0105","quantity":".5","price":"2280.000","unit":"KG","barcode":"09663","tax_amount":"","remark":"","entry_rate":"95.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5640,"sales_order_id":1155,"client_id":40,"product_code":"A0106","quantity":".5","price":"2280.000","unit":"KG","barcode":"09664","tax_amount":"","remark":"","entry_rate":"190.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5641,"sales_order_id":1155,"client_id":40,"product_code":"A0107","quantity":".5","price":"1080.000","unit":"KG","barcode":"002382","tax_amount":"","remark":"","entry_rate":"18.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5642,"sales_order_id":1155,"client_id":40,"product_code":"A0111","quantity":".25","price":"1440.000","unit":"KG","barcode":"002232","tax_amount":"","remark":"","entry_rate":"24.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5643,"sales_order_id":1155,"client_id":40,"product_code":"A0115","quantity":".25","price":"3240.000","unit":"KG","barcode":"09809","tax_amount":"","remark":"","entry_rate":"54.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"}]},{"id":1156,"client_id":40,"order_type":"","type":"O","order_no":"2","user_id":47,"order_status":"pending","date":"2023-02-21 00:00:00","salesman":"SHAMEER","narration":"","dod":"0000-00-00","customer_code":"14259","customer_name":"GRACE HYPERMART","address1":"narayanappa layout horamav agara","address2":"","latitude":"13.0389769","longitude":"77.6541024","location":"(13.0389769, 77.6541024)","invoice_path":"","device_id":"4608fce2bcce875f","cancelled_date":null,"version":1,"status":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z","sales_order_details":[{"id":5644,"sales_order_id":1156,"client_id":40,"product_code":"A0002","quantity":"1.0","price":"377.000","unit":"KG","barcode":"002453","tax_amount":"","remark":"","entry_rate":"58.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5645,"sales_order_id":1156,"client_id":40,"product_code":"A0003","quantity":"1.0","price":"377.000","unit":"KG","barcode":"002454","tax_amount":"","remark":"","entry_rate":"116.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5646,"sales_order_id":1156,"client_id":40,"product_code":"A0011","quantity":"1.0","price":"780.000","unit":"KG","barcode":"002812","tax_amount":"","remark":"","entry_rate":"120.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5647,"sales_order_id":1156,"client_id":40,"product_code":"A0012","quantity":"2.0","price":"780.000","unit":"KG","barcode":"002790","tax_amount":"","remark":"","entry_rate":"240.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5648,"sales_order_id":1156,"client_id":40,"product_code":"A0016","quantity":"1.0","price":"1040.000","unit":"KG","barcode":"002429","tax_amount":"","remark":"","entry_rate":"160.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5649,"sales_order_id":1156,"client_id":40,"product_code":"A0017","quantity":"1.0","price":"1040.000","unit":"KG","barcode":"002430","tax_amount":"","remark":"","entry_rate":"320.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5650,"sales_order_id":1156,"client_id":40,"product_code":"A0021","quantity":"1.0","price":"980.000","unit":"KG","barcode":"002451","tax_amount":"","remark":"","entry_rate":"151.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5651,"sales_order_id":1156,"client_id":40,"product_code":"A0022","quantity":"1.0","price":"980.000","unit":"KG","barcode":"002364","tax_amount":"","remark":"","entry_rate":"302.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5652,"sales_order_id":1156,"client_id":40,"product_code":"A0025","quantity":"1.0","price":"1495.000","unit":"KG","barcode":"002343","tax_amount":"","remark":"","entry_rate":"460.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5653,"sales_order_id":1156,"client_id":40,"product_code":"A0034","quantity":"1.0","price":"1287.000","unit":"KG","barcode":"002945","tax_amount":"","remark":"","entry_rate":"396.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5654,"sales_order_id":1156,"client_id":40,"product_code":"A0045","quantity":"1.0","price":"676.000","unit":"KG","barcode":"002378","tax_amount":"","remark":"","entry_rate":"52.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5655,"sales_order_id":1156,"client_id":40,"product_code":"A0101","quantity":".5","price":"480.000","unit":"KG","barcode":"002386","tax_amount":"","remark":"","entry_rate":"20.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5656,"sales_order_id":1156,"client_id":40,"product_code":"A0113","quantity":".25","price":"1320.000","unit":"KG","barcode":"003050","tax_amount":"","remark":"","entry_rate":"22.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"},{"id":5657,"sales_order_id":1156,"client_id":40,"product_code":"A0117","quantity":".25","price":"1020.000","unit":"KG","barcode":"003082","tax_amount":"","remark":"","entry_rate":"17.000","tax":"","status":1,"version":1,"created_at":"2023-02-21T05:27:52.000000Z","updated_at":"2023-02-21T05:27:52.000000Z"}]}],"cancelled_orders":[],"collections":[]}}
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.