{"title":"JsonObject data type","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/jsonobject/jsonobject-data-type/","by":"JOP-AL","license":"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.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/jsonobject/jsonobject-data-type","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Is a container for any well-formed JSON object.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Instance methods","slug":"instance-methods","at":160,"chars":8494},{"level":2,"title":"Remarks","slug":"remarks","at":8654,"chars":241},{"level":2,"title":"Related information","slug":"related-information","at":8895,"chars":117}],"text":"> Version: _Available or changed with runtime version 1.0._\nIs a container for any well-formed JSON object. A default JsonObject contains an empty JSON object.\n## Instance methods\nThe following methods are available on instances of the JsonObject data type.\nMethod name|Description\nAdd(Text, JsonToken)<jsonobject-add-string-jsontoken-method>|Adds a new property to a JsonObject.\nAdd(Text, JsonObject)<jsonobject-add-string-jsonobject-method>|Adds a new property to a JsonObject.\nAdd(Text, JsonValue)<jsonobject-add-string-jsonvalue-method>|Adds a new property to a JsonObject.\nAdd(Text, JsonArray)<jsonobject-add-string-jsonarray-method>|Adds a new property to a JsonObject.\nAdd(Text, Boolean)<jsonobject-add-string-boolean-method>|Adds a new property to a JsonObject.\nAdd(Text, Char)<jsonobject-add-string-char-method>|Adds a new property to a JsonObject.\nAdd(Text, Byte)<jsonobject-add-string-byte-method>|Adds a new property to a JsonObject.\nAdd(Text, Option)<jsonobject-add-string-option-method>|Adds a new property to a JsonObject.\nAdd(Text, Integer)<jsonobject-add-string-integer-method>|Adds a new property to a JsonObject.\nAdd(Text, BigInteger)<jsonobject-add-string-biginteger-method>|Adds a new property to a JsonObject.\nAdd(Text, Decimal)<jsonobject-add-string-decimal-method>|Adds a new property to a JsonObject.\nAdd(Text, Duration)<jsonobject-add-string-duration-method>|Adds a new property to a JsonObject.\nAdd(Text, Text)<jsonobject-add-string-string-method>|Adds a new property to a JsonObject.\nAdd(Text, Date)<jsonobject-add-string-date-method>|Adds a new property to a JsonObject.\nAdd(Text, Time)<jsonobject-add-string-time-method>|Adds a new property to a JsonObject.\nAdd(Text, DateTime)<jsonobject-add-string-datetime-method>|Adds a new property to a JsonObject.\njsonobject-astoken-method|Converts the value in a JsonObject to a JsonToken data type.\njsonobject-clone-method|Creates a deep-copy of the JsonToken value.\nContains(Text)<jsonobject-contains-method>|Verifies if a JsonObject contains a property with a given key.\nGet(Text, var JsonToken)<jsonobject-get-method>|Retrieves the value of a property with a given key from a JsonObject.\nGetArray(Text [, Boolean])<jsonobject-getarray-method>|Retrieves the value of a property with a given key from a JsonObject as a JsonArray.\nGetBigInteger(Text [, Boolean])<jsonobject-getbiginteger-method>|Retrieves the value of a property with a given key from a JsonObject as a BigInteger.\nGetBoolean(Text [, Boolean])<jsonobject-getboolean-method>|Retrieves the value of a property with a given key from a JsonObject as a Boolean.\nGetByte(Text [, Boolean])<jsonobject-getbyte-method>|Retrieves the value of a property with a given key from a JsonObject as a Byte.\nGetChar(Text [, Boolean])<jsonobject-getchar-method>|Retrieves the value of a property with a given key from a JsonObject as a Char.\nGetDate(Text [, Boolean])<jsonobject-getdate-method>|Retrieves the value of a property with a given key from a JsonObject as a Date.\nGetDateTime(Text [, Boolean])<jsonobject-getdatetime-method>|Retrieves the value of a property with a given key from a JsonObject as a DateTime.\nGetDecimal(Text [, Boolean])<jsonobject-getdecimal-method>|Retrieves the value of a property with a given key from a JsonObject as an Decimal.\nGetDuration(Text [, Boolean])<jsonobject-getduration-method>|Retrieves the value of a property with a given key from a JsonObject as a Duration.\nGetInteger(Text [, Boolean])<jsonobject-getinteger-method>|Retrieves the value of a property with a given key from a JsonObject as an Integer.\nGetObject(Text [, Boolean])<jsonobject-getobject-method>|Retrieves the value of a property with a given key from a JsonObject as a JsonObject.\nGetOption(Text [, Boolean])<jsonobject-getoption-method>|Retrieves the value of a property with a given key from a JsonObject as an Option.\nGetText(Text [, Boolean])<jsonobject-gettext-method>|Retrieves the value of a property with a given key from a JsonObject as Text.\nGetTime(Text [, Boolean])<jsonobject-gettime-method>|Retrieves the value of a property with a given key from a JsonObject as a Time.\njsonobject-keys-method|Gets a set of keys of the JsonObject.\njsonobject-path-method|Retrieves the JSON path of the object relative to the root of its containing tree.\nReadFrom(Text)<jsonobject-readfrom-string-method>|Reads the JSON data from the string into a JsonObject variable.\njsonobject-readfrom-instream-method|Reads the JSON data from the stream into a JsonObject variable.\nReadFromYaml(Text)<jsonobject-readfromyaml-string-method>|Reads the YAML data from the string into a JsonObject variable.\njsonobject-readfromyaml-instream-method|Reads the YAML data from the stream into a JsonObject variable.\nRemove(Text)<jsonobject-remove-method>|Removes the property with the given key from the object.\nReplace(Text, JsonToken)<jsonobject-replace-string-jsontoken-method>|Replaces the value of the property with the given key with the new value.\nReplace(Text, JsonArray)<jsonobject-replace-string-jsonarray-method>|Replaces the value of the property with the given key with the new value.\nReplace(Text, JsonObject)<jsonobject-replace-string-jsonobject-method>|Replaces the value of the property with the given key with the new value.\nReplace(Text, JsonValue)<jsonobject-replace-string-jsonvalue-method>|Replaces the value of the property with the given key with the new value.\nReplace(Text, Boolean)<jsonobject-replace-string-boolean-method>|Replaces the value of the property with the given key with the new value.\nReplace(Text, Char)<jsonobject-replace-string-char-method>|Replaces the value of the property with the given key with the new value.\nReplace(Text, Byte)<jsonobject-replace-string-byte-method>|Replaces the value of the property with the given key with the new value.\nReplace(Text, Integer)<jsonobject-replace-string-integer-method>|Replaces the value of the property with the given key with the new value.\nReplace(Text, Option)<jsonobject-replace-string-option-method>|Replaces the value of the property with the given key with the new value.\nReplace(Text, BigInteger)<jsonobject-replace-string-biginteger-method>|Replaces the value of the property with the given key with the new value.\nReplace(Text, Decimal)<jsonobject-replace-string-decimal-method>|Replaces the value of the property with the given key with the new value.\nReplace(Text, Duration)<jsonobject-replace-string-duration-method>|Replaces the value of the property with the given key with the new value.\nReplace(Text, Date)<jsonobject-replace-string-date-method>|Replaces the value of the property with the given key with the new value.\nReplace(Text, Time)<jsonobject-replace-string-time-method>|Replaces the value of the property with the given key with the new value.\nReplace(Text, DateTime)<jsonobject-replace-string-datetime-method>|Replaces the value of the property with the given key with the new value.\nReplace(Text, Text)<jsonobject-replace-string-string-method>|Replaces the value of the property with the given key with the new value.\nSelectToken(Text, var JsonToken)<jsonobject-selecttoken-method>|Selects a JsonToken using a JPath expression.\nSelectTokens(Text, var List of [JsonToken])<jsonobject-selecttokens-method>|Selects tokens based on a JPath expression and returns them in a new list.\njsonobject-values-method|Gets a set of values of the JsonObject.\nWriteTo(var Text)<jsonobject-writeto-text-method>|Serializes and writes the JSON data of the JsonObject to a given Text object.\njsonobject-writeto-outstream-method|Serializes and writes the JSON data of the JsonObject to a given OutStream object.\nWriteToYaml(var Text)<jsonobject-writetoyaml-text-method>|Serializes and writes the JsonObject as YAML to a given Text object.\njsonobject-writetoyaml-outstream-method|Serializes and writes the content of the JsonObject as YAML text to a given OutStream object.\nWriteWithSecretsTo(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.\nWriteWithSecretsTo(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.\n> NOTE\n> 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.\n## Remarks\nAn 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.\n```\njsonObject.Keys.Count =  0\n```\n## Related information\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}