Hi there @Jakub Ziolkowski, Great question, but to help you out could you provide some more information? Like; What kind of Zap actions are you currently using? Are you using a Javascript code step, what is the code? What is your final goal here? Can you give an example to make it clear What have you tried so far? Objects in javascript can normally be retrieved with object.nestedobject. But like stated above we need to know your current information. Thank you! ~Bjorn Answer from ForYourIT on community.zapier.com
🌐
Adobe
opensource.adobe.com › Spry › samples › data_region › JSONDataSetSample.html
JSON Data Set Sample
The examples on this page attempt to illustrate how the JSON Data Set treats specific formats, and gives examples of the different constructor options that allow the user to tweak its behavior. See our JSON Primer for more information. Example 1 - JSON Array with simple data types as elements. ... Example 4 - The "path" constructor option. Example 5 - The "path" constructor option and JSON Array with objects as elements.
🌐
JAXB
javaee.github.io › tutorial › jsonp001.html
Introduction to JSON
Objects are enclosed in braces ({}), their name-value pairs are separated by a comma (,), and the name and value in a pair are separated by a colon (:). Names in an object are strings, whereas values may be of any of the seven value types, including another object or an array.
🌐
W3Schools
w3schools.com › js › js_json_arrays.asp
JSON Arrays
JS Examples JS HTML DOM JS HTML Input JS HTML Objects JS HTML Events JS Browser JS Editor JS Exercises JS Quiz JS Website JS Syllabus JS Study Plan JS Interview Prep JS Bootcamp JS Certificate JS Reference ... Arrays in JSON are almost the same as arrays in JavaScript. In JSON, array values must be of type string, number, object, array, boolean or null.
🌐
Micro Focus
microfocus.com › documentation › silk-performer › 205 › en › silkperformer-205-webhelp-en › GUID-0847DE13-2A2F-44F2-A6E7-214CD703BF84.html
JSON Array Structure
In contrast to regular arrays from ... are allowed for JSON arrays: [ ] //Empty JSON array [ 0, 1, 2, 3, 4, 5] [ “StringValue”, 10, 20.13, true, null ] [ { “Name” : “Nested Object” }, [ 10, 20, true, 40, “Nested Array” ] ]...
🌐
Leapcell
leapcell.io › blog › understanding-json-arrays-a-practical-guide
Understanding JSON Arrays: A Practical Guide | Leapcell
July 25, 2025 - A JSON array is an ordered list of values enclosed in square brackets []. Each value is separated by a comma and can be of any valid JSON data type: string, number, object, array, boolean, or null.
Find elsewhere
🌐
RestfulAPI
restfulapi.net › home › json › json array
JSON Array - Multi-dimensional Array in JSON
November 4, 2023 - JSON arrays can be of multiple data types. JSON array can store string, number, boolean, object or other array inside JSON array. In JSON array, values must be separated by comma. Arrays in JSON are almost the same as arrays in JavaScript. For example, given below is a JSON document that contains ...
🌐
Codeblogmoney
codeblogmoney.com › json-example-with-data-types-including-json-array
JSON Example with Data Types Including JSON Array
July 3, 2018 - Valid JSON Data Types String Number Object Array Boolean Null 1. JSON String Example: 1 2 3 4 5 { "firstname": "Tom", "lastname": "Cruise", "occupation": "Actor" } This example shows information about a person, and you know Tom Cruise.
🌐
Medium
medium.com › @apdharshi › difference-between-arrays-and-json-objects-fa1c8598f9f1
Difference between Arrays and JSON Objects | by APD | Medium
May 19, 2019 - An object is a collection of properties, and a property is an association between a name (or key) and a value. A property’s value can be a function, in which case the property is known as a method. Object properties are accessed using keys. Keys must be strings, and values must be a valid JSON data type (string, number, object, array, boolean or null). Format { “ ”: “ ” } Example {“position”: “winner”,”country”: “U.S.A”} { “binary”: [{“id”:1,”name”:0},{“id”:2,”name”:1}], “boolean”: [{“id”:1,”value”: false},{“id”:2,”value”: true}
🌐
Reddit
reddit.com › r/csharp › create json with arrays of different types?
r/csharp on Reddit: Create JSON with Arrays of different types?
October 13, 2022 -

I am trying to make a JSON file using C#, and to make a simple one seems pretty easy. but on thing I am struggling with is an array. The entire file falls inside an array, and I can't seem to find documentation enough to make that happen though. Does anyone know how to do this?

Below I posted a link to an example of a JSON I would be interested in making. I created an object in C# that has every variable listed, but I don't know how to format it to have every variable listed in the correct spot. I appreciate any help. Thank you!

https://help.viewpoint.com/en/spectrum/spectrum/api-web-services/api-web-services/list-of-web-services/accounts-payable-services/vendor-invoice-multi-line

Edit: Does indentation matter in JSON? I suppose I could just hardcore a massive string and insert the variables as needed if that’s that case

Top answer
1 of 2
2
Let's go a bit out of order: Does indentation matter in JSON? No. The only things that matter in JSON are the few symbols it uses, it ignores whitespace outside of strings. But also: I don't know how to format it to have every variable listed in the correct spot. Order does not matter in JSON. That's why every property has a name. For the rest of it, here's a quick crash course. You didn't say how you're "making a JSON file". Usually in C# these days, we use a "serialization library". MS has one in I think the System.Text namespace, but before that existed everyone used a package called Newtonsoft.JSON. They both work roughly the same: they convert C# objects to and from JSON. So if I wrote a class like this: public class Example { public int Value { get; set; } } I'd write code (sort of, I'm not double-checking) like this with Newtonsoft: var example = new Example(); example.Value = 10; var json = JsonConvert.SerializeObject(example); The JSON I'd get in return would look like: { "Value": 10 } These libraries support a lot of types by default. We can go backwards from JSON back to C#. Suppose I saw JSON like this: { "examples": [ { "Value": 10 } ] } Think about it by reading from top to bottom. This is: An object with properties: "examples", an array of objects that have these properties: "Value", an integer I see two objects in the definitions, so I need to write two classes: // "an object with an 'examples' property" // Note the name DOES NOT MATTER, because JSON objects do not have type names. public class Examples { // "an array of objects" // Note I can use a capital letter even though the JSON used lowercase, the serializer // is smart enough to handle that. public Example[] Examples { get; set; } } // "an object with a 'Value' property" public class Example { public int Value { get; set; } } The important thing to note is the serializer is smart enough to see that since Examples has an array of Example, it should try to parse the "inner" objects to fit the Example class. My second example intentionally looks a lot like your JSON. You have an object with an "APInvoices" property that is an array of other objects. THOSE objects have many properties, including some like "Images" that are arrays of OTHER objects. To serialize/deserialize your JSON, you're going to need to write 7 or 8 total C# classes.
2 of 2
1
As u/Slypenslyde mentioned, List get serialized to a JSON array in both Newtonsoft.Json and System.Text.Json so may be easier to handle than an array in some situations. You can also use annotations to map a property in JSON to a C# compliant name. using System; using System.Collections.Generic; using System.Text.Json; using System.Text.Json.Serialization; public class Program { public static void Main() { var root = new Root(); int idCnt = 0; // *** ignore this block, just to populate some fake invoices *** for (int i = 0; i < 10; i++) { var invoice = new Invoice() { InvoiceNumber = $"INV{(i + 1).ToString().PadLeft(5, '0')}", VendorCode = $"V{((i % 2) + 1).ToString().PadLeft(5, '0')}", }; int lineCnt = ((i % 2) + 1) * 4; for (int j = 0; j < lineCnt; j++) { idCnt++; invoice.ApInvoiceDetails.Add(new InvoiceLine() { ItemCode = $"PRD{((idCnt % 3) + 1).ToString().PadLeft(5, '0')}", ItemDescription = $"Some product we sell {((idCnt % 3) + 1)}", Quantity = ((j % 4) + 1), Amount = ((j % 3) + 1) * 5 }); } root.ApInvoices.Add(invoice); } // *** end ignore *** // serialize to json string string json = JsonSerializer.Serialize(root); Console.WriteLine(json); // deserialize for json string var newRoot = JsonSerializer.Deserialize(json); Console.WriteLine($"First invoice no: {newRoot.ApInvoices[0].InvoiceNumber}"); } private class Root { [JsonPropertyName("APInvoices")] public List ApInvoices { get; set; } = new(); } private class Invoice { [JsonPropertyName("Vendor_Code")] public string VendorCode { get; set; } [JsonPropertyName("Invoice_Number")] public string InvoiceNumber { get; set; } [JsonPropertyName("APInvoiceDetails")] public List ApInvoiceDetails { get; set; } = new(); } private class InvoiceLine { [JsonPropertyName("Item_Code")] public string ItemCode { get; set; } [JsonPropertyName("Item_Description")] public string ItemDescription { get; set; } public decimal Quantity { get; set; } public decimal Amount { get; set; } } }
🌐
MDN Web Docs
developer.mozilla.org › en-US › docs › Learn_web_development › Core › Scripting › JSON
Working with JSON - Learn web development | MDN
If you load this JSON in your JavaScript program as a string, you can parse it into a normal object and then access the data inside it using the same dot/bracket notation we looked at in the JavaScript object basics article. For example: ... First, we have the variable name — superHeroes. Inside that, we want to access the members property, so we use .members. members contains an array populated by objects.
🌐
JSON Schema
json-schema.org › understanding-json-schema › reference › array
JSON Schema - array
Like with items, if you set unevaluatedItems to false, you can disallow extra items in the array. ... Here, all the values are evaluated. The schema passes validation. ... But here, the schema fails validation because "unevaluatedItems": false specifies that no extra values should exist. ... Note that items doesn't "see inside" any instances of allOf, anyOf, or oneOf in the same subschema. So in this next example, items ignores allOf and thus fails to validate.
Top answer
1 of 7
2

Lean towards option 1, as it's a more expected format.

Option 1 works with JSON as it's designed to be used and therefore benefits from what JSON offers (a degree of human readability, which is good for debugging, and straightforward parsing, which is good for limiting entire categories of bugs to begin with).

Option 2 begrudgingly adopts JSON and subverts many of the benefits. If you don't want human readability, use protobuf or something similar... AIWalker's "CSV"-like approach isn't terrible either. It is marginally better (readable) than splitting objects apart and recombining them. But, this is still not as good (readable) as using JSON "as designed".

Also bear in mind, your API responses are also likely going to be gzipped. Most of the repetition in option 1 will be quickly and transparently condensed over the wire.

As an aside, if you're moving a lot of data, also consider JSONL or paginated results. Pagination can be especially helpful for web clients, as it places natural pauses in the processing, providing a degree of "organic" protection against UI lockups.

2 of 7
3

A list of objects is easier to work with. You can use append, map, filter... All the nice things JS Arrays have which manual indexing doesn't. And there's no way to get out of sync, so that's an entire class of bugs gone.

If you're worried about efficiency:

  • Measure (premature optimization is the root of all evil)
  • Consider the list of lists trick AIWalker proposed
  • Consider an outright binary format
  • Make sure gzip is enabled
  • Measure (it's worth saying twice)
🌐
Gastonsanchez
gastonsanchez.com › intro2cwd › json.html
42 JSON Data | Introduction to Computing With Data
The value can be a single data type, but it can also be a JSON-array (which in turn can contain a JSON-object). Because you have the association of a key with its value, these JSON structures are also referred to as associative arrays. For example, say the key is "year" and the value 2000, then a simple JSON object will look like this:
🌐
W3Schools
w3schools.com › js › js_json.asp
JavaScript JSON
When storing data, the data has to be a certain format, and regardless of where you choose to store it, text is always one of the legal formats. JSON makes it possible to store JavaScript objects as text. Text that defines an employees object with an array of 3 employee objects:
🌐
Quora
quora.com › What-is-the-difference-between-json-array-and-json-object
What is the difference between json array and json object? - Quora
For example: [code ][{"name":"Name 1"},{"name": "Name 2} ][/code] On the other hand, you would use [code ]JSONObject[/code] when dealing with JSON that begins with curly braces. A J...
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › what-is-json-array
What is JSON Array? - GeeksforGeeks
July 23, 2025 - Example: Here we assign a JSON Array of Booleans to the key boolean in jsonBooleanArray object.