Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating JSON #248

Open
stewart-anderson opened this issue Mar 6, 2023 · 2 comments
Open

Generating JSON #248

stewart-anderson opened this issue Mar 6, 2023 · 2 comments

Comments

@stewart-anderson
Copy link

hi,

I've loaded up the project and I can see editing of JSON is fine. I can edit items in an array too and that seems fine.

Is the module supposed to allow extending JSON arrays? There's nothing in the MD and the you tube example only seems to demonstrate working with parsed data.

I want to be able to add elements to an array of items. Starting position is an empty array for example and then reading rows in my sheet to construct the remainder of the data into a JSOn file, ultimately to write it out as .json

I seem to have achieved this with the collection method .add where I added a parsed object to the array of existing items. debug print and when I coped the data out it parsed as JSON. I'm concerned that this isn't a documented feature as its kinda big!

I just wanted to check before I attempt to use it that way that this would not run into issues at some stage.

Am I missing something truly obvious

Ta

Stu

@houghtonap
Copy link

No you are not missing anything. VBA-JSON maps a JSON Array to a VBA.Collection object and maps a JSON Object to a Scripting.Dictionary object. So you need to use the appropriate methods for those objects to make conceptual changes to the JSON being represented by VBA-JSON. You can view the documentation on Microsoft's website.

VBA.Collection
Scripting.Dictionary

See also, issue 195

@stewart-anderson
Copy link
Author

stewart-anderson commented Mar 14, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants