Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Convert json to cursor
Message
From
31/10/2019 09:16:58
 
 
To
31/10/2019 07:44:33
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
01671750
Message ID:
01671756
Views:
69
Your json is not just plain data, it contains an object, and this object has one or more data arrays. So you can't just convert it as is, you must instantiate the json object and "skip" through the array(s).

Have you tried wwJsonSerializer? https://webconnection.west-wind.com/docs/_1wu18owba.htm

>File contains invoice list in json format like:
>
>
{
>    "status": "OK", "statusCode": 200, "messages": null,
>    "data": [{
>        "payment_type": "banktransfer", "fine": "0.200000", "quote_id": null, "order_id": null, "prepayment_id": null, "credited_invoices": [],
>        "interested_party_address_id": 279, "project_id": 875, "currency": "EUR", "owner_id": 3, "date": "2019-03-15", "deadline": "2019-03-20",
>    },
>
>
>    {
>        "payment_type": "banktransfer", "fine": "0.30000", "quote_id": null, "order_id": null, "prepayment_id": null, "credited_invoices": [],
>        "interested_party_address_id": 79, "project_id": 85, "currency": "EUR", "owner_id": 3, "date": "2019-04-15", "deadline": "2019-43-20",
>    }
>    .... more same type elements
>    ]
>}
>
>How to convert it to FoxPro cursor ?
>Cursor sould contain payment_type, fine, quote_id etc columns.
>
>I tried
>
>https://archive.codeplex.com/?p=qdfoxjson
>
>and
>
>http://www.sweetpotatosoftware.com/blog/index.php/2008/12/19/visual-foxpro-json-class-update/
>
>but it looks like they require json to be in different format than my json.
>
>Posted also in https://stackoverflow.com/questions/58642818/how-to-convert-json-to-foxpro-cursor
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform