VBA-tools / VBA-JSON

JSON conversion and parsing for VBA
MIT License
1.79k stars 573 forks source link

Three level nesting #179

Open Fabri73 opened 4 years ago

Fabri73 commented 4 years ago

Hello, does the library sopport 3 level nesting?

Like:

Json("c")("d")("e")

I tried to work it out but it works only with two level nesting.

Cheers F

aholden10 commented 4 years ago

It works. Perhaps post some sample JSON. On Wednesday, October 21, 2020, 11:31:00 AM EDT, Fabri73 notifications@github.com wrote:

Hello, does the library sopport 3 level nesting?

Like:

Json("c")("d")("e")

I tried to work it out but it works only with two level nesting.

Cheers F

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Fabri73 commented 4 years ago

Hi, thanks for answering.

I have been using Ryan Clause's implementation (http://excelerator.solutions/2017/08/16/import-json-to-excel-using-vba/).

I have attached a sample file.

I can easily access: item (“request”)(“type”) but when I try to access: item (“request”)(“Fabrizio”)(“gtin”) I get an error.

Thanks F

TEST JSON2.txt

aholden10 commented 4 years ago

F - since your JSON is all wrapped as an array [] you need to specify the (1) before all your other parameters.  mystring = JSONparsed(1)("request")("type") gives me the result product mystring = JSONparsed(1)("request")("Fabrizio")("gtin") gives me the result 8712561956536 Hope it helps!

On Wednesday, October 21, 2020, 02:06:01 PM EDT, Fabri73 <notifications@github.com> wrote:  

Hi, thanks for answering.

I have been using Ryan Clause's implementation (http://excelerator.solutions/2017/08/16/import-json-to-excel-using-vba/).

I have attached a sample file.

I can easily access: item (“request”)(“type”) but when I try to access: item (“request”)(“Fabrizio”)(“gtin”) I get an error.

Thanks F

TEST JSON2.txt

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub, or unsubscribe.

Fabri73 commented 4 years ago

Great!!! It works. Thanks a lot

aholden10 commented 4 years ago

You are most welcome.  We have all been in your position at one point or another trying to get these things to work! On Wednesday, October 21, 2020, 05:12:58 PM EDT, Fabri73 notifications@github.com wrote:

Great!!! It works. Thanks a lot

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub, or unsubscribe.