# JsonObject.GetOption(Text [, Boolean]) Method
> Version: _Available or changed with runtime version 15.0._
Retrieves the value of a property with a given key from a JsonObject as an Option.
## Syntax
```al
Value :=   JsonObject.GetOption(Key: Text [, DefaultIfNotFound: Boolean])
```
## Parameters
JsonObject
Type: jsonobject-data-type
An instance of the jsonobject-data-type data type.
Key
Type: ../text/text-data-type
The key for the property to read as an Option
*[Optional] DefaultIfNotFound*
Type: ../boolean/boolean-data-type
If true and the key is not found on the object then 0 should be returned. If false and the property is not found on the object an error will be thrown
## Return Value
Value
Type: ../option/option-data-type
The value of the property with the given key as an Option
## Related information
jsonobject-data-type
Getting 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-getoption-method, 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-getoption-method/
