# JsonObject data type
> Version: _Available or changed with runtime version 1.0._
Is a container for any well-formed JSON object. A default JsonObject contains an empty JSON object.
## Instance methods
The following methods are available on instances of the JsonObject data type.
Method name|Description
Add(Text, JsonToken)<jsonobject-add-string-jsontoken-method>|Adds a new property to a JsonObject.
Add(Text, JsonObject)<jsonobject-add-string-jsonobject-method>|Adds a new property to a JsonObject.
Add(Text, JsonValue)<jsonobject-add-string-jsonvalue-method>|Adds a new property to a JsonObject.
Add(Text, JsonArray)<jsonobject-add-string-jsonarray-method>|Adds a new property to a JsonObject.
Add(Text, Boolean)<jsonobject-add-string-boolean-method>|Adds a new property to a JsonObject.
Add(Text, Char)<jsonobject-add-string-char-method>|Adds a new property to a JsonObject.
Add(Text, Byte)<jsonobject-add-string-byte-method>|Adds a new property to a JsonObject.
Add(Text, Option)<jsonobject-add-string-option-method>|Adds a new property to a JsonObject.
Add(Text, Integer)<jsonobject-add-string-integer-method>|Adds a new property to a JsonObject.
Add(Text, BigInteger)<jsonobject-add-string-biginteger-method>|Adds a new property to a JsonObject.
Add(Text, Decimal)<jsonobject-add-string-decimal-method>|Adds a new property to a JsonObject.
Add(Text, Duration)<jsonobject-add-string-duration-method>|Adds a new property to a JsonObject.
Add(Text, Text)<jsonobject-add-string-string-method>|Adds a new property to a JsonObject.
Add(Text, Date)<jsonobject-add-string-date-method>|Adds a new property to a JsonObject.
Add(Text, Time)<jsonobject-add-string-time-method>|Adds a new property to a JsonObject.
Add(Text, DateTime)<jsonobject-add-string-datetime-method>|Adds a new property to a JsonObject.
jsonobject-astoken-method|Converts the value in a JsonObject to a JsonToken data type.
jsonobject-clone-method|Creates a deep-copy of the JsonToken value.
Contains(Text)<jsonobject-contains-method>|Verifies if a JsonObject contains a property with a given key.
Get(Text, var JsonToken)<jsonobject-get-method>|Retrieves the value of a property with a given key from a JsonObject.
GetArray(Text [, Boolean])<jsonobject-getarray-method>|Retrieves the value of a property with a given key from a JsonObject as a JsonArray.
GetBigInteger(Text [, Boolean])<jsonobject-getbiginteger-method>|Retrieves the value of a property with a given key from a JsonObject as a BigInteger.
GetBoolean(Text [, Boolean])<jsonobject-getboolean-method>|Retrieves the value of a property with a given key from a JsonObject as a Boolean.
GetByte(Text [, Boolean])<jsonobject-getbyte-method>|Retrieves the value of a property with a given key from a JsonObject as a Byte.
GetChar(Text [, Boolean])<jsonobject-getchar-method>|Retrieves the value of a property with a given key from a JsonObject as a Char.
GetDate(Text [, Boolean])<jsonobject-getdate-method>|Retrieves the value of a property with a given key from a JsonObject as a Date.
GetDateTime(Text [, Boolean])<jsonobject-getdatetime-method>|Retrieves the value of a property with a given key from a JsonObject as a DateTime.
GetDecimal(Text [, Boolean])<jsonobject-getdecimal-method>|Retrieves the value of a property with a given key from a JsonObject as an Decimal.
GetDuration(Text [, Boolean])<jsonobject-getduration-method>|Retrieves the value of a property with a given key from a JsonObject as a Duration.
GetInteger(Text [, Boolean])<jsonobject-getinteger-method>|Retrieves the value of a property with a given key from a JsonObject as an Integer.
GetObject(Text [, Boolean])<jsonobject-getobject-method>|Retrieves the value of a property with a given key from a JsonObject as a JsonObject.
GetOption(Text [, Boolean])<jsonobject-getoption-method>|Retrieves the value of a property with a given key from a JsonObject as an Option.
GetText(Text [, Boolean])<jsonobject-gettext-method>|Retrieves the value of a property with a given key from a JsonObject as Text.
GetTime(Text [, Boolean])<jsonobject-gettime-method>|Retrieves the value of a property with a given key from a JsonObject as a Time.
jsonobject-keys-method|Gets a set of keys of the JsonObject.
jsonobject-path-method|Retrieves the JSON path of the object relative to the root of its containing tree.
ReadFrom(Text)<jsonobject-readfrom-string-method>|Reads the JSON data from the string into a JsonObject variable.
jsonobject-readfrom-instream-method|Reads the JSON data from the stream into a JsonObject variable.
ReadFromYaml(Text)<jsonobject-readfromyaml-string-method>|Reads the YAML data from the string into a JsonObject variable.
jsonobject-readfromyaml-instream-method|Reads the YAML data from the stream into a JsonObject variable.
Remove(Text)<jsonobject-remove-method>|Removes the property with the given key from the object.
Replace(Text, JsonToken)<jsonobject-replace-string-jsontoken-method>|Replaces the value of the property with the given key with the new value.
Replace(Text, JsonArray)<jsonobject-replace-string-jsonarray-method>|Replaces the value of the property with the given key with the new value.
Replace(Text, JsonObject)<jsonobject-replace-string-jsonobject-method>|Replaces the value of the property with the given key with the new value.
Replace(Text, JsonValue)<jsonobject-replace-string-jsonvalue-method>|Replaces the value of the property with the given key with the new value.
Replace(Text, Boolean)<jsonobject-replace-string-boolean-method>|Replaces the value of the property with the given key with the new value.
Replace(Text, Char)<jsonobject-replace-string-char-method>|Replaces the value of the property with the given key with the new value.
Replace(Text, Byte)<jsonobject-replace-string-byte-method>|Replaces the value of the property with the given key with the new value.
Replace(Text, Integer)<jsonobject-replace-string-integer-method>|Replaces the value of the property with the given key with the new value.
Replace(Text, Option)<jsonobject-replace-string-option-method>|Replaces the value of the property with the given key with the new value.
Replace(Text, BigInteger)<jsonobject-replace-string-biginteger-method>|Replaces the value of the property with the given key with the new value.
Replace(Text, Decimal)<jsonobject-replace-string-decimal-method>|Replaces the value of the property with the given key with the new value.
Replace(Text, Duration)<jsonobject-replace-string-duration-method>|Replaces the value of the property with the given key with the new value.
Replace(Text, Date)<jsonobject-replace-string-date-method>|Replaces the value of the property with the given key with the new value.
Replace(Text, Time)<jsonobject-replace-string-time-method>|Replaces the value of the property with the given key with the new value.
Replace(Text, DateTime)<jsonobject-replace-string-datetime-method>|Replaces the value of the property with the given key with the new value.
Replace(Text, Text)<jsonobject-replace-string-string-method>|Replaces the value of the property with the given key with the new value.
SelectToken(Text, var JsonToken)<jsonobject-selecttoken-method>|Selects a JsonToken using a JPath expression.
SelectTokens(Text, var List of [JsonToken])<jsonobject-selecttokens-method>|Selects tokens based on a JPath expression and returns them in a new list.
jsonobject-values-method|Gets a set of values of the JsonObject.
WriteTo(var Text)<jsonobject-writeto-text-method>|Serializes and writes the JSON data of the JsonObject to a given Text object.
jsonobject-writeto-outstream-method|Serializes and writes the JSON data of the JsonObject to a given OutStream object.
WriteToYaml(var Text)<jsonobject-writetoyaml-text-method>|Serializes and writes the JsonObject as YAML to a given Text object.
jsonobject-writetoyaml-outstream-method|Serializes and writes the content of the JsonObject as YAML text to a given OutStream object.
WriteWithSecretsTo(Text, SecretText, var SecretText)<jsonobject-writewithsecretsto-text-secrettext-secrettext-method>|Replaces the placeholder value in the path with the secret and then serializes and writes the content of the JsonObject to a SecretText.
WriteWithSecretsTo(Dictionary of [Text, SecretText], var SecretText)<jsonobject-writewithsecretsto-dictionary[text,secrettext]-secrettext-method>|Replaces the placeholder values based on their paths with the provided secrets and then serializes and writes the content of the JsonObject to a SecretText.
> NOTE
> For performance reasons all HTTP, JSON, TextBuilder, and XML types are reference types, not value types. Reference types holds a pointer to the data elsewhere in memory, whereas value types store its own data.
## Remarks
An unitialized variable of JsonObject type represents an empty JSON object. Given a value of JsonObject type, you can check if it is empty by checking that the number of keys in the object is 0.
```
jsonObject.Keys.Count =  0
```
## Related information
Get Started with AL<../../devenv-get-started>
Developing Extensions<../../devenv-dev-overview>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/jsonobject/jsonobject-data-type, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/jsonobject/jsonobject-data-type/
