WB still rocks with JSON

Started by stanl, June 30, 2016, 11:17:17 AM

Previous topic - Next topic

stanl

While it may be my last coding in WB for a work-related project, I modified some code I posted in 2011 to address JSON data returned from a cloud application. Per company standards the ultimate code will be Powershell or C#, but WB can prototype in about 1/10 the code and with great results. The challenge was to code to handle a named JSON data set versus an unnamed one.  An example of the former would be

http://gomashup.com/json.php?fds=geo/usa/zipcode/state/NC

and the latter

http://www.w3schools.com/website/customers_mysql.php

The code can currently transform either type of JSON to a .csv with headers, and I am going to extend this to create either Access or SQL Server table entries.  With the loosely typed and very data-driven WB I can accomplish this in under 200 lines of code while I expect C# to take 1-2 thousand, and my C# skills are currently at suck>=8.

Will still be checking in on this board and will help out if I can. And if anyone is working with JSON post any issues.

JTaylor

I started work on a JSON extender but the SDK example was so old it wouldn't convert in the VS version I have and got stalled and then other projects stole my attention....glad to hear your code is still working.

Jim

stanl

Quote from: JTaylor on June 30, 2016, 02:07:47 PM
I started work on a JSON extender but the SDK example was so old it wouldn't convert in the VS version I have and got stalled and then other projects stole my attention....glad to hear your code is still working.

Jim

It works with eval() but not with JSON.Parse() - [using the MsScriptControl].  Rather than returning a node value or even the length, the latter always returns a DISPATCH Object.