---
product: Chilkat
product_version: 11.7.0
language: xojo
language_label: Xojo
class: JsonObject
license: free
deprecated: false
reference_html: https://www.chilkatsoft.com/refdoc/xojoJsonObjectRef.html
---
# Chilkat JsonObject — Xojo — v11.7.0

> Chilkat 11.7.0 · language=xojo · class=JsonObject
> Other versions: replace `11.7.0` in this URL. Other languages: `https://www.chilkatsoft.com/ai-docs/v/11.7.0/<lang>/classes/JsonObject.md`.
> Language-wide rules (install, unlock, error model, strings/bytes): `https://www.chilkatsoft.com/ai-docs/v/11.7.0/xojo/guide.md`.

## Purpose

**Load, navigate, create, modify, search, sort, and emit JSON objects.**

`Chilkat.JsonObject` provides DOM-style access to JSON objects. It can load, inspect, modify, create, search, sort, emit, and save JSON data. It supports path-based access, index-based member access, automatic creation of nested paths, object and array references, Firebase-style updates, record searches, date/time conversion, binary data encoding, variable substitution, and optional secure secret resolution.

**Load and emit JSON**

Load JSON from strings, files, buffers, or Chilkat objects, then emit the result as compact or pretty-formatted JSON.

**Path-based navigation**

Read and update nested values using JSON paths, with support for automatically creating missing object or array paths.

**Member access**

Access object members by name or index, inspect member types, retrieve values, and remove or rename members as needed.

**Nested objects and arrays**

Work directly with child `JsonObject` and `JsonArray` references to navigate and modify complex JSON structures.

**Search and transform**

Search records, sort object members, perform Firebase-style updates, and prepare JSON for API requests or application storage.

**Special value handling**

Handle date/time values, binary data encodings, exact numeric text, variable substitution, and secure secret resolution.

**Common pattern:** Load or create a `JsonObject`, navigate named members and nested paths, retrieve child arrays as `JsonArray` objects when ordered lists are encountered, update values as needed, then emit or save the final JSON. Use `JsonObject` for named JSON members and `JsonArray` for ordered lists.

For an extended overview, see [JsonObject Class Overview](https://www.chilkatsoft.com/jsonobject_class_overview.asp).

## Object creation, unlocking and error handling

**Object Creation**

```xojo
Dim jsonObject As New Chilkat.JsonObject
```

Call `Global.UnlockBundle` once at the start of the program, before using this or any other Chilkat class. Any string unlocks a fully functional 30-day trial; a purchased unlock code is used in production. See `guide.md` for the exact code in Xojo.

How failure is reported depends on the method's return type and is stated in the note under each method below. In every case the diagnostic text is in the `LastErrorText` property of the object whose method was called.

## Members common to every Chilkat class

Documented once per language in `common-members.md`; listed here so this page is self-contained.

| Property | Signature | Access | Meaning |
|---|---|---|---|
| `DebugLogFilePath` | `DebugLogFilePath As String` | read/write | If set to a file path, this property logs the LastErrorText of each Chilkat method or property call to the specified file. |
| `LastErrorHtml` | `LastErrorHtml As String (read-only)` | read-only | Provides HTML-formatted information about the last called method or property. |
| `LastErrorText` | `LastErrorText As String (read-only)` | read-only | Provides plain text information about the last called method or property. |
| `LastErrorXml` | `LastErrorXml As String (read-only)` | read-only | Provides XML-formatted information about the last called method or property. |
| `LastMethodSuccess` | `LastMethodSuccess As Boolean` | read/write | Indicates the success or failure of the most recent method call: `True` means success, `False` means failure. |
| `VerboseLogging` | `VerboseLogging As Boolean` | read/write | If set to `True`, then the contents of LastErrorText (or LastErrorXml, or LastErrorHtml) may contain more verbose information. |
| `Version` | `Version As String (read-only)` | read-only | Version of the component/library, such as "10.1.0" |

## Member index

| Member | Kind | Signature |
|---|---|---|
| `DelimiterChar` | property, read/write | `DelimiterChar As String` |
| `EmitCompact` | property, read/write | `EmitCompact As Boolean` |
| `EmitCrLf` | property, read/write | `EmitCrLf As Boolean` |
| `EnableSecrets` | property, read/write | `EnableSecrets As Boolean` |
| `I` | property, read/write | `I As Int32` |
| `J` | property, read/write | `J As Int32` |
| `K` | property, read/write | `K As Int32` |
| `LowerCaseNames` | property, read/write | `LowerCaseNames As Boolean` |
| `PathPrefix` | property, read/write | `PathPrefix As String` |
| `Size` | property, read-only | `Size As Int32 (read-only)` |
| `Strict` | property, read/write | `Strict As Boolean` |
| `UncommonOptions` | property, read/write | `UncommonOptions As String` |
| `AddArrayAt` | method | `Function AddArrayAt(index As Int32, name As String) As Boolean` |
| `AddArrayCopyAt` | method | `Function AddArrayCopyAt(index As Int32, name As String, jarr As Chilkat.JsonArray) As Boolean` |
| `AddBoolAt` | method | `Function AddBoolAt(index As Int32, name As String, value As Boolean) As Boolean` |
| `AddIntAt` | method | `Function AddIntAt(index As Int32, name As String, value As Int32) As Boolean` |
| `AddNullAt` | method | `Function AddNullAt(index As Int32, name As String) As Boolean` |
| `AddNumberAt` | method | `Function AddNumberAt(index As Int32, name As String, numericStr As String) As Boolean` |
| `AddObjectAt` | method | `Function AddObjectAt(index As Int32, name As String) As Boolean` |
| `AddObjectCopyAt` | method | `Function AddObjectCopyAt(index As Int32, name As String, jsonObj As Chilkat.JsonObject) As Boolean` |
| `AddStringAt` | method | `Function AddStringAt(index As Int32, name As String, value As String) As Boolean` |
| `AppendArray` | method | `Function AppendArray(name As String) As Chilkat.JsonArray` |
| `AppendArray2` | method | `Function AppendArray2(name As String, jarr As Chilkat.JsonArray) As Boolean` |
| `AppendArrayCopy` | method | `Function AppendArrayCopy(name As String, jarr As Chilkat.JsonArray) As Boolean` |
| `AppendBool` | method | `Function AppendBool(name As String, value As Boolean) As Boolean` |
| `AppendInt` | method | `Function AppendInt(name As String, value As Int32) As Boolean` |
| `AppendObject` | method | `Function AppendObject(name As String) As Chilkat.JsonObject` |
| `AppendObject2` | method | `Function AppendObject2(name As String, jsonObj As Chilkat.JsonObject) As Boolean` |
| `AppendObjectCopy` | method | `Function AppendObjectCopy(name As String, jsonObj As Chilkat.JsonObject) As Boolean` |
| `AppendString` | method | `Function AppendString(name As String, value As String) As Boolean` |
| `AppendStringArray` | method | `Function AppendStringArray(name As String, values As Chilkat.StringTable) As Boolean` |
| `ArrayAt` | method | `Function ArrayAt(index As Int32) As Chilkat.JsonArray` |
| `ArrayAt2` | method | `Function ArrayAt2(index As Int32, jarr As Chilkat.JsonArray) As Boolean` |
| `ArrayOf` | method | `Function ArrayOf(jsonPath As String) As Chilkat.JsonArray` |
| `ArrayOf2` | method | `Function ArrayOf2(jsonPath As String, jarr As Chilkat.JsonArray) As Boolean` |
| `BoolAt` | method | `Function BoolAt(index As Int32) As Boolean` |
| `BoolOf` | method | `Function BoolOf(jsonPath As String) As Boolean` |
| `BytesOf` | method | `Function BytesOf(jsonPath As String, encoding As String, bd As Chilkat.BinData) As Boolean` |
| `Clear` | method | `Sub Clear()` |
| `CopyRef` | method | `Function CopyRef(jsonObj As Chilkat.JsonObject) As Boolean` |
| `DateOf` | method | `Function DateOf(jsonPath As String, dt As Chilkat.CkDateTime) As Boolean` |
| `Delete` | method | `Function Delete(name As String) As Boolean` |
| `DeleteAt` | method | `Function DeleteAt(index As Int32) As Boolean` |
| `DeleteRecords` | method | `Function DeleteRecords(arrayPath As String, relpath As String, value As String, caseSensitive As Boolean) As Int32` |
| `DtOf` | method | `Function DtOf(jsonPath As String, bLocal As Boolean, dt As Chilkat.DtObj) As Boolean` |
| `Emit` | method | `Function Emit() As String` |
| `EmitBd` | method | `Function EmitBd(bd As Chilkat.BinData) As Boolean` |
| `EmitSb` | method | `Function EmitSb(sb As Chilkat.StringBuilder) As Boolean` |
| `EmitWithSubs` | method | `Function EmitWithSubs(subs As Chilkat.Hashtable, omitEmpty As Boolean) As String` |
| `FindObjectWithMember` | method | `Function FindObjectWithMember(name As String) As Chilkat.JsonObject` |
| `FindObjectWithMember2` | method | `Function FindObjectWithMember2(name As String, jsonObj As Chilkat.JsonObject) As Boolean` |
| `FindRecord` | method | `Function FindRecord(arrayPath As String, relPath As String, value As String, caseSensitive As Boolean) As Chilkat.JsonObject` |
| `FindRecord2` | method | `Function FindRecord2(arrayPath As String, relPath As String, value As String, caseSensitive As Boolean, jsonObj As Chilkat.JsonObject) As Boolean` |
| `FindRecordString` | method | `Function FindRecordString(arrayPath As String, relPath As String, value As String, caseSensitive As Boolean, retRelPath As String) As String` |
| `FirebaseApplyEvent` | method | `Function FirebaseApplyEvent(name As String, data As String) As Boolean` |
| `FirebasePatch` | method | `Function FirebasePatch(jsonPath As String, jsonData As String) As Boolean` |
| `FirebasePut` | method | `Function FirebasePut(jsonPath As String, value As String) As Boolean` |
| `GetDocRoot` | method | `Function GetDocRoot() As Chilkat.JsonObject` |
| `GetDocRoot2` | method | `Function GetDocRoot2(docRoot As Chilkat.JsonObject) As Boolean` |
| `HasMember` | method | `Function HasMember(jsonPath As String) As Boolean` |
| `IndexOf` | method | `Function IndexOf(name As String) As Int32` |
| `IntAt` | method | `Function IntAt(index As Int32) As Int32` |
| `IntOf` | method | `Function IntOf(jsonPath As String) As Int32` |
| `IsNullAt` | method | `Function IsNullAt(index As Int32) As Boolean` |
| `IsNullOf` | method | `Function IsNullOf(jsonPath As String) As Boolean` |
| `JsonTypeOf` | method | `Function JsonTypeOf(jsonPath As String) As Int32` |
| `Load` | method | `Function Load(json As String) As Boolean` |
| `LoadBd` | method | `Function LoadBd(bd As Chilkat.BinData) As Boolean` |
| `LoadFile` | method | `Function LoadFile(path As String) As Boolean` |
| `LoadPredefined` | method | `Function LoadPredefined(name As String) As Boolean` |
| `LoadSb` | method | `Function LoadSb(sb As Chilkat.StringBuilder) As Boolean` |
| `MakeCopy` | method | `Function MakeCopy(json As Chilkat.JsonObject) As Boolean` |
| `MoveMember` | method | `Function MoveMember(fromIndex As Int32, toIndex As Int32) As Boolean` |
| `NameAt` | method | `Function NameAt(index As Int32) As String` |
| `NewArrayOf` | method | `Function NewArrayOf(path As String, jArr As String) As Boolean` |
| `NewObjectOf` | method | `Function NewObjectOf(path As String, jObj As String) As Boolean` |
| `ObjectAt` | method | `Function ObjectAt(index As Int32) As Chilkat.JsonObject` |
| `ObjectAt2` | method | `Function ObjectAt2(index As Int32, jsonObj As Chilkat.JsonObject) As Boolean` |
| `ObjectOf` | method | `Function ObjectOf(jsonPath As String) As Chilkat.JsonObject` |
| `ObjectOf2` | method | `Function ObjectOf2(jsonPath As String, jsonObj As Chilkat.JsonObject) As Boolean` |
| `Predefine` | method | `Function Predefine(name As String) As Boolean` |
| `Rename` | method | `Function Rename(oldName As String, newName As String) As Boolean` |
| `RenameAt` | method | `Function RenameAt(index As Int32, name As String) As Boolean` |
| `SetBoolAt` | method | `Function SetBoolAt(index As Int32, value As Boolean) As Boolean` |
| `SetBoolOf` | method | `Function SetBoolOf(jsonPath As String, value As Boolean) As Boolean` |
| `SetIntAt` | method | `Function SetIntAt(index As Int32, value As Int32) As Boolean` |
| `SetIntOf` | method | `Function SetIntOf(jsonPath As String, value As Int32) As Boolean` |
| `SetNullAt` | method | `Function SetNullAt(index As Int32) As Boolean` |
| `SetNullOf` | method | `Function SetNullOf(jsonPath As String) As Boolean` |
| `SetNumberAt` | method | `Function SetNumberAt(index As Int32, value As String) As Boolean` |
| `SetNumberOf` | method | `Function SetNumberOf(jsonPath As String, value As String) As Boolean` |
| `SetStringAt` | method | `Function SetStringAt(index As Int32, value As String) As Boolean` |
| `SetStringOf` | method | `Function SetStringOf(jsonPath As String, value As String) As Boolean` |
| `SizeOfArray` | method | `Function SizeOfArray(jsonPath As String) As Int32` |
| `Sort` | method | `Sub Sort(ascending As Boolean, caseSensitive As Boolean)` |
| `StringAt` | method | `Function StringAt(index As Int32) As String` |
| `StringOf` | method | `Function StringOf(jsonPath As String) As String` |
| `StringOfEquals` | method | `Function StringOfEquals(jsonPath As String, value As String, caseSensitive As Boolean) As Boolean` |
| `StringOfSb` | method | `Function StringOfSb(jsonPath As String, sb As Chilkat.StringBuilder) As Boolean` |
| `Swap` | method | `Function Swap(index1 As Int32, index2 As Int32) As Boolean` |
| `TypeAt` | method | `Function TypeAt(index As Int32) As Int32` |
| `UIntOf` | method | `Function UIntOf(jsonPath As String) As UInt32` |
| `UpdateBd` | method | `Function UpdateBd(jsonPath As String, encoding As String, bd As Chilkat.BinData) As Boolean` |
| `UpdateBool` | method | `Function UpdateBool(jsonPath As String, value As Boolean) As Boolean` |
| `UpdateInt` | method | `Function UpdateInt(jsonPath As String, value As Int32) As Boolean` |
| `UpdateNewArray` | method | `Function UpdateNewArray(jsonPath As String) As Boolean` |
| `UpdateNewObject` | method | `Function UpdateNewObject(jsonPath As String) As Boolean` |
| `UpdateNull` | method | `Function UpdateNull(jsonPath As String) As Boolean` |
| `UpdateNumber` | method | `Function UpdateNumber(jsonPath As String, numericStr As String) As Boolean` |
| `UpdateSb` | method | `Function UpdateSb(jsonPath As String, sb As Chilkat.StringBuilder) As Boolean` |
| `UpdateString` | method | `Function UpdateString(jsonPath As String, value As String) As Boolean` |
| `UpdateUInt` | method | `Function UpdateUInt(jsonPath As String, value As UInt32) As Boolean` |
| `WriteFile` | method | `Function WriteFile(path As String) As Boolean` |

Deprecated members are listed at the end of this file with their replacements; do not use them in new code.

## Properties

### JsonObject.DelimiterChar

`Chilkat 11.7.0 · xojo · JsonObject · DelimiterChar · property · read/write · since 9.5.0.58`

```xojo
DelimiterChar As String
```

Specifies the character used to separate object-member names in Chilkat JSON paths. The default is `.`. Set it to `/` for Firebase-style paths. This property should contain exactly one character.

**Arrays in paths:** Array indexes continue to use square brackets, such as `orders[0].id`. If a member name itself contains a path-separator character, quote that path component with double quotes.

### JsonObject.EmitCompact

`Chilkat 11.7.0 · xojo · JsonObject · EmitCompact · property · read/write · since 9.5.0.56`

```xojo
EmitCompact As Boolean
```

Controls whether emitted JSON is compact or pretty-printed. The default is `True`.

|  |  |
| --- | --- |
| `True` | Emit a compact representation with no extra formatting whitespace. |
| `False` | Emit indented, human-readable JSON. |

**JSON semantics:** Formatting whitespace does not change the JSON data. Use compact output for transport/storage and pretty output for diagnostics or human review.

### JsonObject.EmitCrLf

`Chilkat 11.7.0 · xojo · JsonObject · EmitCrLf · property · read/write · since 9.5.0.56`

```xojo
EmitCrLf As Boolean
```

Controls line endings when pretty-printed JSON is emitted (`EmitCompact = False`). The default is `True`.

|  |  |
| --- | --- |
| `True` | Use CRLF line endings. |
| `False` | Use LF line endings. |

**Compact output:** This setting has no effect when `EmitCompact` is `True` because compact JSON is emitted without formatting line breaks.

### JsonObject.EnableSecrets

`Chilkat 11.7.0 · xojo · JsonObject · EnableSecrets · property · read/write · since 11.5.0`

```xojo
EnableSecrets As Boolean
```

**Full documentation for this property (same in every language):** [More Detailed Information About EnableSecrets](https://www.chilkatsoft.com/ai-docs/v/11.7.0/articles/secret_specification_strings.md)

Enables automatic resolution of Chilkat secret specification strings for supported string-setting methods. The default is `False`. When enabled, a value beginning with `!!` can identify a credential stored in Windows Credential Manager or Apple Keychain instead of embedding the literal secret in application code.

Secret specification format: `!![appName|]service[|domain]|username`.

This feature applies to `AddStringAt`, `AppendString`, `SetStringAt`, `SetStringOf`, `UpdateSb`, and `UpdateString`.

**Security:** Secret resolution changes where the string value comes from; the resulting JSON member still contains the resolved value. Avoid emitting or logging JSON that contains credentials unless that exposure is explicitly intended.

### JsonObject.I

`Chilkat 11.7.0 · xojo · JsonObject · I · property · read/write · since 9.5.0.56`

```xojo
I As Int32
```

Supplies the integer substituted for `i` when a JSON path contains an array index such as `[i]`. This is useful for loop-based navigation without constructing a new path string for every iteration.

**Related properties:** The `J` and `K` properties provide the same substitution behavior for `[j]` and `[k]`.

### JsonObject.J

`Chilkat 11.7.0 · xojo · JsonObject · J · property · read/write · since 9.5.0.56`

```xojo
J As Int32
```

Supplies the integer substituted for `j` when a JSON path contains `[j]`. It is commonly used with nested-array paths such as `matrix[i][j]`.

### JsonObject.K

`Chilkat 11.7.0 · xojo · JsonObject · K · property · read/write · since 9.5.0.56`

```xojo
K As Int32
```

Supplies the integer substituted for `k` when a JSON path contains `[k]`. It can be combined with `I` and `J` for deeper nested-array traversal.

### JsonObject.LowerCaseNames

`Chilkat 11.7.0 · xojo · JsonObject · LowerCaseNames · property · read/write · since 9.5.0.87`

```xojo
LowerCaseNames As Boolean
```

If `True`, member names are converted to lowercase while JSON is loaded by `Load`, `LoadBd`, `LoadSb`, or `LoadFile`. The default is `False`.

**Important:** This changes member names in the parsed document; it is not merely a case-insensitive lookup mode. Use it only when normalizing names is intentional.

### JsonObject.PathPrefix

`Chilkat 11.7.0 · xojo · JsonObject · PathPrefix · property · read/write · since 9.5.0.76`

```xojo
PathPrefix As String
```

Specifies a path prefix automatically prepended to JSON paths passed to path-based methods such as `StringOf`, `ObjectOf`, `UpdateString`, `SetBoolOf`, and `SizeOfArray`. The default is the empty string.

**Use case:** Set a prefix when many operations target the same nested object. The individual method calls can then use paths relative to that prefix.

### JsonObject.Size

`Chilkat 11.7.0 · xojo · JsonObject · Size · property · read-only · since 9.5.0.56`

```xojo
Size As Int32 (read-only)
```

Returns the number of direct name/value members in this JSON object. Nested members inside child objects are not included.

**JSON objects and order:** RFC 8259 defines a JSON object as an unordered collection of name/value pairs. Chilkat preserves a member order so index-based APIs and deterministic emission are possible, but interoperable application logic should generally use member names rather than depend on object order.

### JsonObject.Strict

`Chilkat 11.7.0 · xojo · JsonObject · Strict · property · read/write · since 11.6.0`

```xojo
Strict As Boolean
```

When `Strict` is **true**, the Load methods first check that the data is well-formed JSON. If it is not, the load fails and the contents of this JsonObject are left **unchanged**. The default is `False`.

This applies to `Load`, `LoadSb`, `LoadBd`, `LoadFile` and `LoadPredefined`.

Chilkat's JSON parser is deliberately tolerant. By default it can accept text that is not well-formed, succeed, and leave an empty or partially populated document. That is convenient when the goal is a best-effort parse of imperfect input, but it is the wrong behavior when a silently missing member changes what the application does. A single missing comma, for example, can cause the members after it to be dropped while the load still reports success.

Set `Strict` to `True` for JSON carrying configuration, credentials, or security parameters, where a member that quietly failed to load would be acted on as though it had never been specified.

**Note:** The default is `False` so that existing applications are unaffected. When a strict load is rejected, this JsonObject keeps whatever it held before the call, so a failed reload never leaves the object empty.

### JsonObject.UncommonOptions

`Chilkat 11.7.0 · xojo · JsonObject · UncommonOptions · property · read/write · since 9.5.0.90`

```xojo
UncommonOptions As String
```

Provides a catch-all string for uncommon, implementation-specific options. The default is the empty string and it should normally remain empty.

**Recommendation:** Do not invent option keywords. Set this property only when a specific `JsonObject` option is documented by Chilkat or provided by Chilkat support.

## Methods

### JsonObject.AddArrayAt

`Chilkat 11.7.0 · xojo · JsonObject · AddArrayAt · method · since 9.5.0.56`

```xojo
Function AddArrayAt(index As Int32, name As String) As Boolean
```

Inserts a new JSON array member named `name` at the zero-based member position `index`. The new array is empty.

|  |  |
| --- | --- |
| `0` | Insert as the first member. |
| `-1` | Append as the last member. |
| `n` | Insert at zero-based position n. |

**Member name vs. JSON path:** `name` is a direct member name, not a JSON path. Use an `Update*` or `Set*Of` method when addressing a nested value by path.

Returns True for success, False for failure.

### JsonObject.AddArrayCopyAt

`Chilkat 11.7.0 · xojo · JsonObject · AddArrayCopyAt · method · since 9.5.0.82`

```xojo
Function AddArrayCopyAt(index As Int32, name As String, jarr As Chilkat.JsonArray) As Boolean
```

Inserts a new JSON array member named `name` at the zero-based member position `index`. The array value is copied from `jarr`; subsequent changes to the source array do not modify the inserted copy.

|  |  |
| --- | --- |
| `0` | Insert as the first member. |
| `-1` | Append as the last member. |
| `n` | Insert at zero-based position n. |

**Member name vs. JSON path:** `name` is a direct member name, not a JSON path. Use an `Update*` or `Set*Of` method when addressing a nested value by path.

Returns True for success, False for failure.

### JsonObject.AddBoolAt

`Chilkat 11.7.0 · xojo · JsonObject · AddBoolAt · method · since 9.5.0.56`

```xojo
Function AddBoolAt(index As Int32, name As String, value As Boolean) As Boolean
```

Inserts a new JSON boolean member named `name` at the zero-based member position `index`. The value is taken from `value`.

|  |  |
| --- | --- |
| `0` | Insert as the first member. |
| `-1` | Append as the last member. |
| `n` | Insert at zero-based position n. |

**Member name vs. JSON path:** `name` is a direct member name, not a JSON path. Use an `Update*` or `Set*Of` method when addressing a nested value by path.

Returns True for success, False for failure.

### JsonObject.AddIntAt

`Chilkat 11.7.0 · xojo · JsonObject · AddIntAt · method · since 9.5.0.56`

```xojo
Function AddIntAt(index As Int32, name As String, value As Int32) As Boolean
```

Inserts a new JSON number member named `name` at the zero-based member position `index`. The integer `value` is emitted as a JSON number, not as a quoted string.

|  |  |
| --- | --- |
| `0` | Insert as the first member. |
| `-1` | Append as the last member. |
| `n` | Insert at zero-based position n. |

**Member name vs. JSON path:** `name` is a direct member name, not a JSON path. Use an `Update*` or `Set*Of` method when addressing a nested value by path.

Returns True for success, False for failure.

### JsonObject.AddNullAt

`Chilkat 11.7.0 · xojo · JsonObject · AddNullAt · method · since 9.5.0.56`

```xojo
Function AddNullAt(index As Int32, name As String) As Boolean
```

Inserts a new JSON null member named `name` at the zero-based member position `index`.

|  |  |
| --- | --- |
| `0` | Insert as the first member. |
| `-1` | Append as the last member. |
| `n` | Insert at zero-based position n. |

**Member name vs. JSON path:** `name` is a direct member name, not a JSON path. Use an `Update*` or `Set*Of` method when addressing a nested value by path.

Returns True for success, False for failure.

### JsonObject.AddNumberAt

`Chilkat 11.7.0 · xojo · JsonObject · AddNumberAt · method · since 9.5.0.56`

```xojo
Function AddNumberAt(index As Int32, name As String, numericStr As String) As Boolean
```

Inserts a new JSON number member named `name` at the zero-based member position `index`. The `numericStr` argument supplies the exact JSON numeric text to store.

|  |  |
| --- | --- |
| `0` | Insert as the first member. |
| `-1` | Append as the last member. |
| `n` | Insert at zero-based position n. |

**Member name vs. JSON path:** `name` is a direct member name, not a JSON path. Use an `Update*` or `Set*Of` method when addressing a nested value by path.

**Exact numeric text:** Use this method when lexical form or precision matters, for example `12345678901234567890`, `1.2500`, or scientific notation. The supplied text must be valid JSON number syntax; JSON does not permit `NaN` or infinity.

Returns True for success, False for failure.

### JsonObject.AddObjectAt

`Chilkat 11.7.0 · xojo · JsonObject · AddObjectAt · method · since 9.5.0.56`

```xojo
Function AddObjectAt(index As Int32, name As String) As Boolean
```

Inserts a new JSON object member named `name` at the zero-based member position `index`. The new object is empty.

|  |  |
| --- | --- |
| `0` | Insert as the first member. |
| `-1` | Append as the last member. |
| `n` | Insert at zero-based position n. |

**Member name vs. JSON path:** `name` is a direct member name, not a JSON path. Use an `Update*` or `Set*Of` method when addressing a nested value by path.

Returns True for success, False for failure.

### JsonObject.AddObjectCopyAt

`Chilkat 11.7.0 · xojo · JsonObject · AddObjectCopyAt · method · since 9.5.0.82`

```xojo
Function AddObjectCopyAt(index As Int32, name As String, jsonObj As Chilkat.JsonObject) As Boolean
```

Inserts a new JSON object member named `name` at the zero-based member position `index`. The object value is copied from `jsonObj`; the inserted value is independent of the source.

|  |  |
| --- | --- |
| `0` | Insert as the first member. |
| `-1` | Append as the last member. |
| `n` | Insert at zero-based position n. |

**Member name vs. JSON path:** `name` is a direct member name, not a JSON path. Use an `Update*` or `Set*Of` method when addressing a nested value by path.

Returns True for success, False for failure.

### JsonObject.AddStringAt

`Chilkat 11.7.0 · xojo · JsonObject · AddStringAt · method · since 9.5.0.56`

```xojo
Function AddStringAt(index As Int32, name As String, value As String) As Boolean
```

Inserts a new JSON string member named `name` at the zero-based member position `index`. The value is stored as a JSON string and is escaped as needed when emitted.

|  |  |
| --- | --- |
| `0` | Insert as the first member. |
| `-1` | Append as the last member. |
| `n` | Insert at zero-based position n. |

**Member name vs. JSON path:** `name` is a direct member name, not a JSON path. Use an `Update*` or `Set*Of` method when addressing a nested value by path.

Returns True for success, False for failure.

### JsonObject.AppendArray

`Chilkat 11.7.0 · xojo · JsonObject · AppendArray · method · since 9.5.0.58`

```xojo
Function AppendArray(name As String) As Chilkat.JsonArray
```

Appends a new JSON array member named `name` to this object. The newly appended array is empty and the returned `JsonArray` references that array in this document, so changes made through it modify the same JSON tree.

**Member name vs. JSON path:** `name` is a direct member name. It is not interpreted as a JSON path. Use the corresponding `Update*` method when a nested path should be addressed or created.

Returns `Nil` on failure

### JsonObject.AppendArray2

`Chilkat 11.7.0 · xojo · JsonObject · AppendArray2 · method · since 11.0.0`

```xojo
Function AppendArray2(name As String, jarr As Chilkat.JsonArray) As Boolean
```

Appends a new JSON array member named `name` to this object. A new empty array is created and `jarr` is updated to reference it. The method returns `True` on success.

**Member name vs. JSON path:** `name` is a direct member name. It is not interpreted as a JSON path. Use the corresponding `Update*` method when a nested path should be addressed or created.

Returns True for success, False for failure.

### JsonObject.AppendArrayCopy

`Chilkat 11.7.0 · xojo · JsonObject · AppendArrayCopy · method · since 9.5.0.82`

```xojo
Function AppendArrayCopy(name As String, jarr As Chilkat.JsonArray) As Boolean
```

Appends a new JSON array member named `name` to this object. The array is copied from `jarr`, so the appended array is independent of the source array.

**Member name vs. JSON path:** `name` is a direct member name. It is not interpreted as a JSON path. Use the corresponding `Update*` method when a nested path should be addressed or created.

Returns True for success, False for failure.

### JsonObject.AppendBool

`Chilkat 11.7.0 · xojo · JsonObject · AppendBool · method · since 9.5.0.58`

```xojo
Function AppendBool(name As String, value As Boolean) As Boolean
```

Appends a new JSON boolean member named `name` to this object. The value is taken from `value`.

**Member name vs. JSON path:** `name` is a direct member name. It is not interpreted as a JSON path. Use the corresponding `Update*` method when a nested path should be addressed or created.

Returns True for success, False for failure.

### JsonObject.AppendInt

`Chilkat 11.7.0 · xojo · JsonObject · AppendInt · method · since 9.5.0.58`

```xojo
Function AppendInt(name As String, value As Int32) As Boolean
```

Appends a new JSON number member named `name` to this object. The integer value is stored as a JSON number.

**Member name vs. JSON path:** `name` is a direct member name. It is not interpreted as a JSON path. Use the corresponding `Update*` method when a nested path should be addressed or created.

Returns True for success, False for failure.

### JsonObject.AppendObject

`Chilkat 11.7.0 · xojo · JsonObject · AppendObject · method · since 9.5.0.58`

```xojo
Function AppendObject(name As String) As Chilkat.JsonObject
```

Appends a new JSON object member named `name` to this object. The newly appended object is empty and the returned `JsonObject` references that object in this document.

**Member name vs. JSON path:** `name` is a direct member name. It is not interpreted as a JSON path. Use the corresponding `Update*` method when a nested path should be addressed or created.

Returns `Nil` on failure

### JsonObject.AppendObject2

`Chilkat 11.7.0 · xojo · JsonObject · AppendObject2 · method · since 11.0.0`

```xojo
Function AppendObject2(name As String, jsonObj As Chilkat.JsonObject) As Boolean
```

Appends a new JSON object member named `name` to this object. A new empty object is created and `jsonObj` is updated to reference it. The method returns `True` on success.

**Member name vs. JSON path:** `name` is a direct member name. It is not interpreted as a JSON path. Use the corresponding `Update*` method when a nested path should be addressed or created.

Returns True for success, False for failure.

### JsonObject.AppendObjectCopy

`Chilkat 11.7.0 · xojo · JsonObject · AppendObjectCopy · method · since 9.5.0.82`

```xojo
Function AppendObjectCopy(name As String, jsonObj As Chilkat.JsonObject) As Boolean
```

Appends a new JSON object member named `name` to this object. The object is copied from `jsonObj`, so the appended object is independent of the source object.

**Member name vs. JSON path:** `name` is a direct member name. It is not interpreted as a JSON path. Use the corresponding `Update*` method when a nested path should be addressed or created.

Returns True for success, False for failure.

### JsonObject.AppendString

`Chilkat 11.7.0 · xojo · JsonObject · AppendString · method · since 9.5.0.58`

```xojo
Function AppendString(name As String, value As String) As Boolean
```

Appends a new JSON string member named `name` to this object. The value is JSON-escaped as needed when emitted.

**Member name vs. JSON path:** `name` is a direct member name. It is not interpreted as a JSON path. Use the corresponding `Update*` method when a nested path should be addressed or created.

Returns True for success, False for failure.

### JsonObject.AppendStringArray

`Chilkat 11.7.0 · xojo · JsonObject · AppendStringArray · method · since 9.5.0.67`

```xojo
Function AppendStringArray(name As String, values As Chilkat.StringTable) As Boolean
```

Appends a new JSON array member named `name` to this object. The array is populated with the strings contained in `values`.

**Member name vs. JSON path:** `name` is a direct member name. It is not interpreted as a JSON path. Use the corresponding `Update*` method when a nested path should be addressed or created.

Returns True for success, False for failure.

### JsonObject.ArrayAt

`Chilkat 11.7.0 · xojo · JsonObject · ArrayAt · method · since 9.5.0.56`

```xojo
Function ArrayAt(index As Int32) As Chilkat.JsonArray
```

Returns the JSON array stored in the member at zero-based position `index`. The returned `JsonArray` references the existing array in the same document; it is not a detached copy.

**Type requirement:** The member at `index` must be an array. Use `TypeAt` when the member type is not already known.

Returns `Nil` on failure

### JsonObject.ArrayAt2

`Chilkat 11.7.0 · xojo · JsonObject · ArrayAt2 · method · since 11.0.0`

```xojo
Function ArrayAt2(index As Int32, jarr As Chilkat.JsonArray) As Boolean
```

Updates `jarr` to reference the JSON array stored at zero-based member position `index` and returns `True` on success.

Returns True for success, False for failure.

### JsonObject.ArrayOf

`Chilkat 11.7.0 · xojo · JsonObject · ArrayOf · method · since 9.5.0.56`

```xojo
Function ArrayOf(jsonPath As String) As Chilkat.JsonArray
```

Returns the JSON array at `jsonPath`. The returned `JsonArray` references the existing array in the same document, so modifications through it are reflected in the parent JSON.

**JSON paths:** Paths are relative to this object and may include object-member separators and array indexes, for example `orders[0].items`.

Returns `Nil` on failure

### JsonObject.ArrayOf2

`Chilkat 11.7.0 · xojo · JsonObject · ArrayOf2 · method · since 11.1.0`

```xojo
Function ArrayOf2(jsonPath As String, jarr As Chilkat.JsonArray) As Boolean
```

Updates `jarr` to reference the JSON array at `jsonPath` and returns `True` on success.

Returns True for success, False for failure.

### JsonObject.BoolAt

`Chilkat 11.7.0 · xojo · JsonObject · BoolAt · method · since 9.5.0.56`

```xojo
Function BoolAt(index As Int32) As Boolean
```

Returns the boolean value of the member at zero-based position `index`.

**Indexing:** Member indexes are based on the order maintained by this `JsonObject` instance. JSON objects are semantically unordered, so application protocols should normally identify values by member name rather than by position.

### JsonObject.BoolOf

`Chilkat 11.7.0 · xojo · JsonObject · BoolOf · method · since 9.5.0.56`

```xojo
Function BoolOf(jsonPath As String) As Boolean
```

Returns the boolean value at `jsonPath`. The path is evaluated relative to this `JsonObject`, after applying `PathPrefix` if one is set.

### JsonObject.BytesOf

`Chilkat 11.7.0 · xojo · JsonObject · BytesOf · method · since 9.5.0.68`

```xojo
Function BytesOf(jsonPath As String, encoding As String, bd As Chilkat.BinData) As Boolean
```

Reads the string value at `jsonPath`, decodes it using `encoding` (for example, `base64` or `hex`), and appends the resulting bytes to `bd`.

**Binary-in-JSON convention:** The JSON member itself is text. The `encoding` argument tells Chilkat how that text represents the original bytes.

Returns True for success, False for failure.

### JsonObject.Clear

`Chilkat 11.7.0 · xojo · JsonObject · Clear · method · since 9.5.0.76`

```xojo
Sub Clear()
```

Removes all members from this JSON object, leaving an empty object equivalent to `{}`.

### JsonObject.CopyRef

`Chilkat 11.7.0 · xojo · JsonObject · CopyRef · method · since 11.0.0`

```xojo
Function CopyRef(jsonObj As Chilkat.JsonObject) As Boolean
```

Updates `jsonObj` so that it references the same JSON object as the caller. No JSON data is copied.

**Shared state:** After this call, modifications through either reference affect the same underlying JSON object.

Returns True for success, False for failure.

### JsonObject.DateOf

`Chilkat 11.7.0 · xojo · JsonObject · DateOf · method · since 9.5.0.73`

```xojo
Function DateOf(jsonPath As String, dt As Chilkat.CkDateTime) As Boolean
```

Parses the date/time value at `jsonPath` and loads the result into `dt`. Recognized forms include ISO 8601 timestamps (for example, `2009-11-04T19:55:41Z`), RFC 822-style date/time strings, and Unix timestamp integers.

**JSON has no native date type:** Dates in JSON are application conventions, usually represented as strings or numbers. This method recognizes common conventions and converts them to `CkDateTime`.

Returns True for success, False for failure.

### JsonObject.Delete

`Chilkat 11.7.0 · xojo · JsonObject · Delete · method · since 9.5.0.56`

```xojo
Function Delete(name As String) As Boolean
```

Deletes the direct member named `name` from this JSON object.

**Not a path:** `name` is a member name, not a JSON path. Use a path-based operation when deleting or replacing a nested value requires navigation first.

Returns True for success, False for failure.

### JsonObject.DeleteAt

`Chilkat 11.7.0 · xojo · JsonObject · DeleteAt · method · since 9.5.0.56`

```xojo
Function DeleteAt(index As Int32) As Boolean
```

Deletes the member at zero-based position `index`. Members after the deleted position shift toward the beginning.

Returns True for success, False for failure.

### JsonObject.DeleteRecords

`Chilkat 11.7.0 · xojo · JsonObject · DeleteRecords · method · since 9.5.0.88`

```xojo
Function DeleteRecords(arrayPath As String, relpath As String, value As String, caseSensitive As Boolean) As Int32
```

Deletes every object record in the array at `arrayPath` whose value at relative path `relpath` equals or wildcard-matches `value`. The `caseSensitive` argument controls matching. Returns the number of records deleted.

### JsonObject.DtOf

`Chilkat 11.7.0 · xojo · JsonObject · DtOf · method · since 9.5.0.73`

```xojo
Function DtOf(jsonPath As String, bLocal As Boolean, dt As Chilkat.DtObj) As Boolean
```

Parses the date/time value at `jsonPath` into `dt`. If `bLocal` is `True`, the destination receives local date/time fields; otherwise it receives UTC/GMT fields. Recognized inputs include ISO 8601 timestamps, RFC 822-style date/time strings, and Unix timestamp integers.

Returns True for success, False for failure.

### JsonObject.Emit

`Chilkat 11.7.0 · xojo · JsonObject · Emit · method · since 9.5.0.56`

```xojo
Function Emit() As String
```

Serializes the JSON document rooted at this object and returns the JSON text. Formatting is controlled by `EmitCompact` and, for pretty output, `EmitCrLf`.

**Object member order:** Chilkat emits members in its maintained order, but JSON object ordering is not semantically significant under RFC 8259.

Returns `Nil` on failure

### JsonObject.EmitBd

`Chilkat 11.7.0 · xojo · JsonObject · EmitBd · method · since 9.5.0.77`

```xojo
Function EmitBd(bd As Chilkat.BinData) As Boolean
```

Serializes this JSON and appends the resulting bytes to `bd`.

**Append behavior:** Existing data in the destination `BinData` is preserved.

Returns True for success, False for failure.

### JsonObject.EmitSb

`Chilkat 11.7.0 · xojo · JsonObject · EmitSb · method · since 9.5.0.62`

```xojo
Function EmitSb(sb As Chilkat.StringBuilder) As Boolean
```

Serializes this JSON and appends the resulting text to `sb`. Formatting follows `EmitCompact` and `EmitCrLf`.

**Append behavior:** Existing text in the destination `StringBuilder` is preserved; the emitted JSON is added after it.

Returns True for success, False for failure.

### JsonObject.EmitWithSubs

`Chilkat 11.7.0 · xojo · JsonObject · EmitWithSubs · method · since 9.5.0.67`

```xojo
Function EmitWithSubs(subs As Chilkat.Hashtable, omitEmpty As Boolean) As String
```

Serializes the JSON after substituting variables from `subs` into template strings. A placeholder such as `{$name}` is replaced by the corresponding hashtable value. Prefixing the variable name with `i.`, as in `{$i.count}`, emits the substituted value as a JSON integer instead of a quoted string.

If `omitEmpty` is `True`, members whose substituted result is an empty string or empty array are omitted from the emitted JSON.

**Template reuse:** This method does not require rebuilding the JSON template. It is commonly paired with `Predefine` and `LoadPredefined` when the same JSON shape is emitted repeatedly with different values.

Returns `Nil` on failure

### JsonObject.FindObjectWithMember

`Chilkat 11.7.0 · xojo · JsonObject · FindObjectWithMember · method · since 9.5.0.67`

```xojo
Function FindObjectWithMember(name As String) As Chilkat.JsonObject
```

Recursively searches this JSON subtree for the first JSON object containing a direct member named `name`. Returns that object, or `Nil` if no matching object is found.

Returns `Nil` on failure

### JsonObject.FindObjectWithMember2

`Chilkat 11.7.0 · xojo · JsonObject · FindObjectWithMember2 · method · since 11.0.0`

```xojo
Function FindObjectWithMember2(name As String, jsonObj As Chilkat.JsonObject) As Boolean
```

Recursively searches this JSON subtree for the first object containing a direct member named `name`. On success, `jsonObj` is updated to reference the matching object and the method returns `True`.

Returns True for success, False for failure.

### JsonObject.FindRecord

`Chilkat 11.7.0 · xojo · JsonObject · FindRecord · method · since 9.5.0.63`

```xojo
Function FindRecord(arrayPath As String, relPath As String, value As String, caseSensitive As Boolean) As Chilkat.JsonObject
```

Searches the JSON array at `arrayPath` for the first object whose value at relative path `relPath` equals or wildcard-matches `value`. The `caseSensitive` argument controls string comparison. Returns the matching record object.

**Wildcard matching:** The search value may contain `*` to match zero or more characters. `relPath` is evaluated relative to each record object in the array.

Returns `Nil` on failure

### JsonObject.FindRecord2

`Chilkat 11.7.0 · xojo · JsonObject · FindRecord2 · method · since 11.0.0`

```xojo
Function FindRecord2(arrayPath As String, relPath As String, value As String, caseSensitive As Boolean, jsonObj As Chilkat.JsonObject) As Boolean
```

Searches the JSON array at `arrayPath` using the same matching rules as `FindRecord`. On success, `jsonObj` is updated to reference the first matching record and the method returns `True`.

**Reference semantics:** The destination references the record in the original JSON document; changes made through `jsonObj` modify that record.

Returns True for success, False for failure.

### JsonObject.FindRecordString

`Chilkat 11.7.0 · xojo · JsonObject · FindRecordString · method · since 9.5.0.63`

```xojo
Function FindRecordString(arrayPath As String, relPath As String, value As String, caseSensitive As Boolean, retRelPath As String) As String
```

Searches the JSON array at `arrayPath` for the first record whose `relPath` value equals or wildcard-matches `value`, then returns the value at `retRelPath` from that same record as a string.

**Typical use:** This is useful for lookups such as “find the record where `Name` is `Advertising` and return its `Id`.” The `*` wildcard may be used in `value`.

Returns `Nil` on failure

### JsonObject.FirebaseApplyEvent

`Chilkat 11.7.0 · xojo · JsonObject · FirebaseApplyEvent · method · since 9.5.0.58`

```xojo
Function FirebaseApplyEvent(name As String, data As String) As Boolean
```

Applies a Firebase Realtime Database event to this JSON object. `name` should be `put` or `patch`, and `data` should contain event JSON such as `{"path":"/","data":{"a":1,"b":2}}`.

**Purpose:** This method is useful when maintaining a local JSON representation from Firebase server-sent events: `put` replaces the value at a path, while `patch` updates individual child keys.

Returns True for success, False for failure.

### JsonObject.FirebasePatch

`Chilkat 11.7.0 · xojo · JsonObject · FirebasePatch · method · since 9.5.0.58`

```xojo
Function FirebasePatch(jsonPath As String, jsonData As String) As Boolean
```

Applies Firebase-style patch semantics at `jsonPath`. `jsonData` must contain a JSON object; each key in that object updates or adds the corresponding key at the target path.

**Relative path:** `jsonPath` is relative to this `JsonObject`.

Returns True for success, False for failure.

### JsonObject.FirebasePut

`Chilkat 11.7.0 · xojo · JsonObject · FirebasePut · method · since 9.5.0.58`

```xojo
Function FirebasePut(jsonPath As String, value As String) As Boolean
```

Applies Firebase-style put semantics at `jsonPath`, replacing or inserting the value at that path. `value` is JSON text and may represent an object, array, number, boolean, `null`, or a quoted JSON string.

**Quoted strings:** To store a string through this method, `value` must contain a valid JSON string literal, including its surrounding double quotes. Use `UpdateString` when you already have an ordinary application string.

Returns True for success, False for failure.

### JsonObject.GetDocRoot

`Chilkat 11.7.0 · xojo · JsonObject · GetDocRoot · method · since 9.5.0.56`

```xojo
Function GetDocRoot() As Chilkat.JsonObject
```

Returns a `JsonObject` reference to the root object of the JSON document containing this object. This can be called from any nested object reference.

**Shared document lifetime:** Nested `JsonObject` references share the same underlying JSON document. The document remains available while at least one such reference is retained by the application.

Returns `Nil` on failure

### JsonObject.GetDocRoot2

`Chilkat 11.7.0 · xojo · JsonObject · GetDocRoot2 · method · since 11.0.0`

```xojo
Function GetDocRoot2(docRoot As Chilkat.JsonObject) As Boolean
```

Updates `docRoot` to reference the root object of the JSON document containing the caller and returns `True` on success.

**Reference semantics:** The destination is another reference into the same underlying document; it is not a copy.

Returns True for success, False for failure.

### JsonObject.HasMember

`Chilkat 11.7.0 · xojo · JsonObject · HasMember · method · since 9.5.0.58`

```xojo
Function HasMember(jsonPath As String) As Boolean
```

Returns `True` if a value exists at `jsonPath`; otherwise returns `False`.

**Missing vs. null:** A member whose JSON value is `null` still exists. Use `IsNullOf` to test specifically for JSON `null`.

Returns True for success, False for failure.

### JsonObject.IndexOf

`Chilkat 11.7.0 · xojo · JsonObject · IndexOf · method · since 9.5.0.56`

```xojo
Function IndexOf(name As String) As Int32
```

Returns the zero-based position of the direct member named `name`, or `-1` if that member name is not found.

**Not a path:** `name` is searched only among the direct members of this object.

### JsonObject.IntAt

`Chilkat 11.7.0 · xojo · JsonObject · IntAt · method · since 9.5.0.56`

```xojo
Function IntAt(index As Int32) As Int32
```

Returns the integer value of the member at zero-based position `index`.

**Indexing:** Member indexes are based on the order maintained by this `JsonObject` instance. JSON objects are semantically unordered, so application protocols should normally identify values by member name rather than by position.

### JsonObject.IntOf

`Chilkat 11.7.0 · xojo · JsonObject · IntOf · method · since 9.5.0.56`

```xojo
Function IntOf(jsonPath As String) As Int32
```

Returns the integer value at `jsonPath`. The path is evaluated relative to this `JsonObject`, after applying `PathPrefix` if one is set.

**Large numbers:** Use `StringOf` or the exact numeric-text APIs when a JSON integer may exceed the range of the language binding's integer type.

### JsonObject.IsNullAt

`Chilkat 11.7.0 · xojo · JsonObject · IsNullAt · method · since 9.5.0.56`

```xojo
Function IsNullAt(index As Int32) As Boolean
```

Returns `True` if the member at zero-based position `index` has the JSON value `null`; otherwise returns `False`.

### JsonObject.IsNullOf

`Chilkat 11.7.0 · xojo · JsonObject · IsNullOf · method · since 9.5.0.56`

```xojo
Function IsNullOf(jsonPath As String) As Boolean
```

Returns `True` if the value at `jsonPath` is the JSON literal `null`; otherwise returns `False`.

**Null is a value:** JSON `null` is different from a missing member and from an empty string. Use `HasMember` when existence must be tested separately.

### JsonObject.JsonTypeOf

`Chilkat 11.7.0 · xojo · JsonObject · JsonTypeOf · method · since 9.5.0.68`

```xojo
Function JsonTypeOf(jsonPath As String) As Int32
```

Returns an integer identifying the JSON type of the value at `jsonPath`. Returns `-1` if no member exists at that path.

|  |  |
| --- | --- |
| `1` | string |
| `2` | number |
| `3` | object |
| `4` | array |
| `5` | boolean |
| `6` | null |

### JsonObject.Load

`Chilkat 11.7.0 · xojo · JsonObject · Load · method · since 9.5.0.56`

```xojo
Function Load(json As String) As Boolean
```

Parses the JSON text in `json` and loads the parsed data into this object for DOM-style access and modification.

**JSON data model:** JSON values are strings, numbers, booleans, `null`, objects, or arrays. Object member names should be unique for interoperable JSON; RFC 8259 notes that consumers differ in how duplicate names are handled.

Returns True for success, False for failure.

### JsonObject.LoadBd

`Chilkat 11.7.0 · xojo · JsonObject · LoadBd · method · since 9.5.0.77`

```xojo
Function LoadBd(bd As Chilkat.BinData) As Boolean
```

Parses JSON from the bytes contained in `bd` and loads it into this object.

Returns True for success, False for failure.

### JsonObject.LoadFile

`Chilkat 11.7.0 · xojo · JsonObject · LoadFile · method · since 9.5.0.56`

```xojo
Function LoadFile(path As String) As Boolean
```

Reads JSON text from the file at `path`, parses it, and loads the result into this object.

Returns True for success, False for failure.

### JsonObject.LoadPredefined

`Chilkat 11.7.0 · xojo · JsonObject · LoadPredefined · method · since 9.5.0.67`

```xojo
Function LoadPredefined(name As String) As Boolean
```

Loads this object from the predefined JSON document identified by `name`. Predefined documents are created with `Predefine`.

Returns True for success, False for failure.

### JsonObject.LoadSb

`Chilkat 11.7.0 · xojo · JsonObject · LoadSb · method · since 9.5.0.62`

```xojo
Function LoadSb(sb As Chilkat.StringBuilder) As Boolean
```

Parses JSON from the current contents of `sb` and loads it into this object.

Returns True for success, False for failure.

### JsonObject.MakeCopy

`Chilkat 11.7.0 · xojo · JsonObject · MakeCopy · method · since 11.0.0`

```xojo
Function MakeCopy(json As Chilkat.JsonObject) As Boolean
```

Copies this JSON object into `json`. The destination receives an independent JSON copy rather than another reference to the same underlying object.

**Copy vs. reference:** Use `CopyRef` when two `JsonObject` instances should refer to the same JSON object instead of duplicating its data.

Returns True for success, False for failure.

### JsonObject.MoveMember

`Chilkat 11.7.0 · xojo · JsonObject · MoveMember · method · since 9.5.0.80`

```xojo
Function MoveMember(fromIndex As Int32, toIndex As Int32) As Boolean
```

Moves the direct member at zero-based position `fromIndex` to `toIndex`. Use `toIndex = 0` to move it first or `-1` to move it last.

Returns True for success, False for failure.

### JsonObject.NameAt

`Chilkat 11.7.0 · xojo · JsonObject · NameAt · method · since 9.5.0.56`

```xojo
Function NameAt(index As Int32) As String
```

Returns the name of the member at zero-based position `index`. Use this with `Size` and `TypeAt` to iterate through an object's direct members.

Returns `Nil` on failure

### JsonObject.NewArrayOf

`Chilkat 11.7.0 · xojo · JsonObject · NewArrayOf · method · since 11.4.0`

```xojo
Function NewArrayOf(path As String, jArr As String) As Boolean
```

Creates a JSON array at `path` and loads that array from the JSON text in `jArr`. The supplied text should represent a JSON array.

**Difference from UpdateNewArray:** `UpdateNewArray` creates an empty array. `NewArrayOf` creates the array and immediately populates it from JSON text.

Returns True for success, False for failure.

### JsonObject.NewObjectOf

`Chilkat 11.7.0 · xojo · JsonObject · NewObjectOf · method · since 11.4.0`

```xojo
Function NewObjectOf(path As String, jObj As String) As Boolean
```

Creates a JSON object at `path` and loads that object from the JSON text in `jObj`. The supplied text should represent a JSON object.

**Difference from UpdateNewObject:** `UpdateNewObject` creates an empty object. `NewObjectOf` creates the object and immediately populates it from JSON text.

Returns True for success, False for failure.

### JsonObject.ObjectAt

`Chilkat 11.7.0 · xojo · JsonObject · ObjectAt · method · since 9.5.0.56`

```xojo
Function ObjectAt(index As Int32) As Chilkat.JsonObject
```

Returns the JSON object stored in the member at zero-based position `index`. The returned `JsonObject` references the existing child object in the same document; changes made through it modify that document.

**Type requirement:** The member at `index` must be a JSON object. Use `TypeAt` when the type is not already known.

Returns `Nil` on failure

### JsonObject.ObjectAt2

`Chilkat 11.7.0 · xojo · JsonObject · ObjectAt2 · method · since 11.0.0`

```xojo
Function ObjectAt2(index As Int32, jsonObj As Chilkat.JsonObject) As Boolean
```

Updates `jsonObj` to reference the JSON object stored at zero-based member position `index` and returns `True` on success.

Returns True for success, False for failure.

### JsonObject.ObjectOf

`Chilkat 11.7.0 · xojo · JsonObject · ObjectOf · method · since 9.5.0.56`

```xojo
Function ObjectOf(jsonPath As String) As Chilkat.JsonObject
```

Returns the JSON object at `jsonPath`. The returned object is a live reference into the same JSON document, not a copy.

**Relative paths:** A path is evaluated relative to the current object. Use `GetDocRoot` when access must start from the document root.

Returns `Nil` on failure

### JsonObject.ObjectOf2

`Chilkat 11.7.0 · xojo · JsonObject · ObjectOf2 · method · since 11.0.0`

```xojo
Function ObjectOf2(jsonPath As String, jsonObj As Chilkat.JsonObject) As Boolean
```

Updates `jsonObj` to reference the JSON object at `jsonPath` and returns `True` on success.

Returns True for success, False for failure.

### JsonObject.Predefine

`Chilkat 11.7.0 · xojo · JsonObject · Predefine · method · since 9.5.0.67`

```xojo
Function Predefine(name As String) As Boolean
```

Stores this JSON document in Chilkat's internal global collection of predefined JSON documents under `name`. If the name already exists, the predefined value is replaced.

**Template use:** After predefining a document, another `JsonObject` can load it by name with `LoadPredefined`.

Returns True for success, False for failure.

### JsonObject.Rename

`Chilkat 11.7.0 · xojo · JsonObject · Rename · method · since 9.5.0.56`

```xojo
Function Rename(oldName As String, newName As String) As Boolean
```

Renames the direct member `oldName` to `newName`. The member value and its position are otherwise unchanged.

**JSON interoperability:** JSON object member names should be unique. Avoid renaming a member to a name already used by another member unless duplicate names are intentionally required.

Returns True for success, False for failure.

### JsonObject.RenameAt

`Chilkat 11.7.0 · xojo · JsonObject · RenameAt · method · since 9.5.0.56`

```xojo
Function RenameAt(index As Int32, name As String) As Boolean
```

Renames the member at zero-based position `index` to `name`. The member value is not changed.

Returns True for success, False for failure.

### JsonObject.SetBoolAt

`Chilkat 11.7.0 · xojo · JsonObject · SetBoolAt · method · since 9.5.0.56`

```xojo
Function SetBoolAt(index As Int32, value As Boolean) As Boolean
```

Sets the member at zero-based position `index` to a JSON boolean value.

Returns True for success, False for failure.

### JsonObject.SetBoolOf

`Chilkat 11.7.0 · xojo · JsonObject · SetBoolOf · method · since 9.5.0.56`

```xojo
Function SetBoolOf(jsonPath As String, value As Boolean) As Boolean
```

Sets the value at `jsonPath` to a JSON boolean value.

**Set vs. Update:** Use `UpdateBool` when missing objects or array positions along the path should be created automatically.

Returns True for success, False for failure.

### JsonObject.SetIntAt

`Chilkat 11.7.0 · xojo · JsonObject · SetIntAt · method · since 9.5.0.56`

```xojo
Function SetIntAt(index As Int32, value As Int32) As Boolean
```

Sets the member at zero-based position `index` to a JSON number value. The integer is emitted as a JSON number.

Returns True for success, False for failure.

### JsonObject.SetIntOf

`Chilkat 11.7.0 · xojo · JsonObject · SetIntOf · method · since 9.5.0.56`

```xojo
Function SetIntOf(jsonPath As String, value As Int32) As Boolean
```

Sets the value at `jsonPath` to an integer JSON number.

**Set vs. Update:** Use `UpdateInt` when missing objects or array positions along the path should be created automatically.

Returns True for success, False for failure.

### JsonObject.SetNullAt

`Chilkat 11.7.0 · xojo · JsonObject · SetNullAt · method · since 9.5.0.56`

```xojo
Function SetNullAt(index As Int32) As Boolean
```

Sets the member at zero-based position `index` to a JSON null value.

Returns True for success, False for failure.

### JsonObject.SetNullOf

`Chilkat 11.7.0 · xojo · JsonObject · SetNullOf · method · since 9.5.0.56`

```xojo
Function SetNullOf(jsonPath As String) As Boolean
```

Sets the value at `jsonPath` to a JSON null value.

**Set vs. Update:** Use `UpdateNull` when missing objects or array positions along the path should be created automatically.

Returns True for success, False for failure.

### JsonObject.SetNumberAt

`Chilkat 11.7.0 · xojo · JsonObject · SetNumberAt · method · since 9.5.0.56`

```xojo
Function SetNumberAt(index As Int32, value As String) As Boolean
```

Sets the member at zero-based position `index` to a JSON number value. The `value` argument is the exact textual representation of the JSON number.

**JSON number syntax:** The text may contain an integer, fraction, or exponent. It must be valid JSON number syntax; leading zeros (except for zero itself), `NaN`, and infinity are not valid JSON numbers.

Returns True for success, False for failure.

### JsonObject.SetNumberOf

`Chilkat 11.7.0 · xojo · JsonObject · SetNumberOf · method · since 9.5.0.56`

```xojo
Function SetNumberOf(jsonPath As String, value As String) As Boolean
```

Sets the value at `jsonPath` to a JSON number value. The `value` argument supplies the exact textual form of the JSON number.

**Set vs. Update:** Use `UpdateNumber` when missing objects or array positions along the path should be created automatically.

**Precision:** Using numeric text avoids an intermediate conversion through a floating-point type and can therefore preserve large integers or application-specific decimal formatting.

Returns True for success, False for failure.

### JsonObject.SetStringAt

`Chilkat 11.7.0 · xojo · JsonObject · SetStringAt · method · since 9.5.0.56`

```xojo
Function SetStringAt(index As Int32, value As String) As Boolean
```

Sets the member at zero-based position `index` to a JSON string value. The string is escaped as required when JSON is emitted.

Returns True for success, False for failure.

### JsonObject.SetStringOf

`Chilkat 11.7.0 · xojo · JsonObject · SetStringOf · method · since 9.5.0.56`

```xojo
Function SetStringOf(jsonPath As String, value As String) As Boolean
```

Sets the value at `jsonPath` to a JSON string value. The string is escaped as required when JSON is emitted.

**Set vs. Update:** Use `UpdateString` when missing objects or array positions along the path should be created automatically.

Returns True for success, False for failure.

### JsonObject.SizeOfArray

`Chilkat 11.7.0 · xojo · JsonObject · SizeOfArray · method · since 9.5.0.56`

```xojo
Function SizeOfArray(jsonPath As String) As Int32
```

Returns the number of elements in the JSON array at `jsonPath`. Returns `-1` if the path does not resolve to an existing JSON array.

### JsonObject.Sort

`Chilkat 11.7.0 · xojo · JsonObject · Sort · method · since 9.5.0.100`

```xojo
Sub Sort(ascending As Boolean, caseSensitive As Boolean)
```

Sorts this object's direct members by member name. `ascending` selects ascending or descending order, and `caseSensitive` controls how names are compared.

**JSON semantics:** Member ordering is not significant to JSON consumers, but sorting can make emitted JSON deterministic and easier to compare or review.

### JsonObject.StringAt

`Chilkat 11.7.0 · xojo · JsonObject · StringAt · method · since 9.5.0.56`

```xojo
Function StringAt(index As Int32) As String
```

Returns the string value of the member at zero-based position `index`.

**Indexing:** Member indexes are based on the order maintained by this `JsonObject` instance. JSON objects are semantically unordered, so application protocols should normally identify values by member name rather than by position.

**Non-string values:** `StringOf` can also provide textual representations of scalar JSON values such as numbers, booleans, and `null`; use the type-specific methods when the JSON type itself matters.

Returns `Nil` on failure

### JsonObject.StringOf

`Chilkat 11.7.0 · xojo · JsonObject · StringOf · method · since 9.5.0.56`

```xojo
Function StringOf(jsonPath As String) As String
```

Returns the value at `jsonPath` as text. For a JSON string, the string value is returned. Scalar non-string values such as numbers, booleans, and `null` are returned using their JSON textual representation.

**Type-sensitive code:** Use `JsonTypeOf`, `IntOf`, `BoolOf`, or `IsNullOf` when the distinction between JSON types is important.

Returns `Nil` on failure

### JsonObject.StringOfEquals

`Chilkat 11.7.0 · xojo · JsonObject · StringOfEquals · method · since 9.5.0.96`

```xojo
Function StringOfEquals(jsonPath As String, value As String, caseSensitive As Boolean) As Boolean
```

Returns `True` if the textual value at `jsonPath` equals `value` according to the `caseSensitive` setting; otherwise returns `False`.

### JsonObject.StringOfSb

`Chilkat 11.7.0 · xojo · JsonObject · StringOfSb · method · since 9.5.0.68`

```xojo
Function StringOfSb(jsonPath As String, sb As Chilkat.StringBuilder) As Boolean
```

Retrieves the value at `jsonPath` as text and appends it to `sb`.

**Append behavior:** Existing contents of the destination `StringBuilder` are preserved.

Returns True for success, False for failure.

### JsonObject.Swap

`Chilkat 11.7.0 · xojo · JsonObject · Swap · method · since 9.5.0.76`

```xojo
Function Swap(index1 As Int32, index2 As Int32) As Boolean
```

Swaps the positions of the direct members at zero-based indexes `index1` and `index2`. Member names and values are unchanged.

**Ordering:** JSON object order is not semantically significant, but Chilkat preserves an order for index-based access and emission.

Returns True for success, False for failure.

### JsonObject.TypeAt

`Chilkat 11.7.0 · xojo · JsonObject · TypeAt · method · since 9.5.0.58`

```xojo
Function TypeAt(index As Int32) As Int32
```

Returns an integer identifying the JSON type of the member at zero-based position `index`. Returns `-1` if no member exists at that index.

|  |  |
| --- | --- |
| `1` | string |
| `2` | number |
| `3` | object |
| `4` | array |
| `5` | boolean |
| `6` | null |

### JsonObject.UIntOf

`Chilkat 11.7.0 · xojo · JsonObject · UIntOf · method · since 9.5.0.96`

```xojo
Function UIntOf(jsonPath As String) As UInt32
```

Returns the unsigned integer value at `jsonPath`.

### JsonObject.UpdateBd

`Chilkat 11.7.0 · xojo · JsonObject · UpdateBd · method · since 9.5.0.68`

```xojo
Function UpdateBd(jsonPath As String, encoding As String, bd As Chilkat.BinData) As Boolean
```

Updates the value at `jsonPath` to a JSON string value, or creates the member and any missing path components as needed. The bytes in `bd` are first encoded according to `encoding` (for example, `base64` or `hex`) and the encoded text is stored as the JSON string value.

**Path-based operation:** `jsonPath` is interpreted using `DelimiterChar`, `PathPrefix`, and the `I`/`J`/`K` index substitutions.

**Binary data in JSON:** JSON has no native byte-array type. Binary content must therefore be represented using a textual encoding agreed upon by the producer and consumer.

Returns True for success, False for failure.

### JsonObject.UpdateBool

`Chilkat 11.7.0 · xojo · JsonObject · UpdateBool · method · since 9.5.0.63`

```xojo
Function UpdateBool(jsonPath As String, value As Boolean) As Boolean
```

Updates the value at `jsonPath` to a JSON boolean value, or creates the member and any missing path components as needed.

**Path-based operation:** `jsonPath` is interpreted using `DelimiterChar`, `PathPrefix`, and the `I`/`J`/`K` index substitutions.

Returns True for success, False for failure.

### JsonObject.UpdateInt

`Chilkat 11.7.0 · xojo · JsonObject · UpdateInt · method · since 9.5.0.63`

```xojo
Function UpdateInt(jsonPath As String, value As Int32) As Boolean
```

Updates the value at `jsonPath` to a JSON number value, or creates the member and any missing path components as needed. The integer value is stored as a JSON number.

**Path-based operation:** `jsonPath` is interpreted using `DelimiterChar`, `PathPrefix`, and the `I`/`J`/`K` index substitutions.

Returns True for success, False for failure.

### JsonObject.UpdateNewArray

`Chilkat 11.7.0 · xojo · JsonObject · UpdateNewArray · method · since 9.5.0.75`

```xojo
Function UpdateNewArray(jsonPath As String) As Boolean
```

Creates or replaces the value at `jsonPath` with a new empty JSON array. Missing path components are created automatically as needed.

Returns True for success, False for failure.

### JsonObject.UpdateNewObject

`Chilkat 11.7.0 · xojo · JsonObject · UpdateNewObject · method · since 9.5.0.75`

```xojo
Function UpdateNewObject(jsonPath As String) As Boolean
```

Creates or replaces the value at `jsonPath` with a new empty JSON object. Missing path components are created automatically as needed.

Returns True for success, False for failure.

### JsonObject.UpdateNull

`Chilkat 11.7.0 · xojo · JsonObject · UpdateNull · method · since 9.5.0.65`

```xojo
Function UpdateNull(jsonPath As String) As Boolean
```

Updates the value at `jsonPath` to a JSON null value, or creates the member and any missing path components as needed.

**Path-based operation:** `jsonPath` is interpreted using `DelimiterChar`, `PathPrefix`, and the `I`/`J`/`K` index substitutions.

Returns True for success, False for failure.

### JsonObject.UpdateNumber

`Chilkat 11.7.0 · xojo · JsonObject · UpdateNumber · method · since 9.5.0.65`

```xojo
Function UpdateNumber(jsonPath As String, numericStr As String) As Boolean
```

Updates the value at `jsonPath` to a JSON number value, or creates the member and any missing path components as needed. The `numericStr` argument is stored as the exact textual representation of the JSON number.

**Path-based operation:** `jsonPath` is interpreted using `DelimiterChar`, `PathPrefix`, and the `I`/`J`/`K` index substitutions.

**When to use:** Use `UpdateNumber` instead of `UpdateInt` for decimal/exponent forms, very large integers, or when preserving exact numeric text is important.

Returns True for success, False for failure.

### JsonObject.UpdateSb

`Chilkat 11.7.0 · xojo · JsonObject · UpdateSb · method · since 9.5.0.68`

```xojo
Function UpdateSb(jsonPath As String, sb As Chilkat.StringBuilder) As Boolean
```

Updates the value at `jsonPath` to a JSON string value, or creates the member and any missing path components as needed. The new string value is taken from the contents of `sb`.

**Path-based operation:** `jsonPath` is interpreted using `DelimiterChar`, `PathPrefix`, and the `I`/`J`/`K` index substitutions.

Returns True for success, False for failure.

### JsonObject.UpdateString

`Chilkat 11.7.0 · xojo · JsonObject · UpdateString · method · since 9.5.0.63`

```xojo
Function UpdateString(jsonPath As String, value As String) As Boolean
```

Updates the value at `jsonPath` to a JSON string value, or creates the member and any missing path components as needed. The supplied string is JSON-escaped as needed.

**Path-based operation:** `jsonPath` is interpreted using `DelimiterChar`, `PathPrefix`, and the `I`/`J`/`K` index substitutions.

**Version note:** Chilkat versions prior to 9.5.0.68 did not correctly escape all characters for this method. Version 9.5.0.68 and later correct that behavior.

Returns True for success, False for failure.

### JsonObject.UpdateUInt

`Chilkat 11.7.0 · xojo · JsonObject · UpdateUInt · method · since 9.5.0.96`

```xojo
Function UpdateUInt(jsonPath As String, value As UInt32) As Boolean
```

Updates the value at `jsonPath` to a JSON number value, or creates the member and any missing path components as needed. The unsigned integer is stored as a JSON number.

**Path-based operation:** `jsonPath` is interpreted using `DelimiterChar`, `PathPrefix`, and the `I`/`J`/`K` index substitutions.

Returns True for success, False for failure.

### JsonObject.WriteFile

`Chilkat 11.7.0 · xojo · JsonObject · WriteFile · method · since 9.5.0.76`

```xojo
Function WriteFile(path As String) As Boolean
```

Serializes this JSON and writes it to the file at `path`. Output formatting follows `EmitCompact` and `EmitCrLf`.

Returns True for success, False for failure.

## Deprecated members — do not use in new code

| Member | Kind | Deprecated in | Use instead |
|---|---|---|---|
| `Clone` | method | before 11.6.1 | `MakeCopy` |

## Related classes

[`BinData`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/xojo/classes/BinData.md), [`CkDateTime`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/xojo/classes/CkDateTime.md), [`DtObj`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/xojo/classes/DtObj.md), [`Hashtable`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/xojo/classes/Hashtable.md), [`JsonArray`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/xojo/classes/JsonArray.md), [`StringBuilder`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/xojo/classes/StringBuilder.md), [`StringTable`](https://www.chilkatsoft.com/ai-docs/v/11.7.0/xojo/classes/StringTable.md)

