Skip to content

Generating JSON #248

Open
Open

Description

@stewart-anderson

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

Activity

  1. houghtonap commented on Mar 9, 2023

    @houghtonap

    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

  2. stewart-anderson commented on Mar 14, 2023

    @stewart-anderson
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions