# Variant.IsBoolean() Method
> Version: _Available or changed with runtime version 1.0._
Indicates whether an AL variant contains a Boolean variable.
## Syntax
```al
Ok :=   Variant.IsBoolean()
```
> NOTE
> This method can be invoked using property access syntax.
## Parameters
Variant
Type: variant-data-type
An instance of the variant-data-type data type.
## Return Value
Ok
Type: ../boolean/boolean-data-type
true if the AL variant contains a Boolean variable, otherwise false.
## Example
The following example determines whether an AL variant contains a Boolean variable. The code initializes the MyBoolean variable with a Boolean value. The MyBoolean variable is assigned to the variant variable that is named MyVariant. The IsBoolean method determines whether the variant contains a Boolean variable and stores the return value in the varResult variable. In this case, the variant contains a Boolean variable so true is returned and displayed in a message box. The Boolean value is obtained from the Critical field in the Item table. The variant-iscode-method determines whether the variant contains a code variable. The return value is false because the variant does not contain a code.
```al
var
    ItemRec: Record Item;
    MyBoolean: Boolean;
    MyVariant: Variant;
    varResult: Boolean;
    Text000: Label 'Does the variant >%1< contain a Boolean variable? %2.';
    Text001: Label 'Does the variant >%1< contain a code variable? %2.';
begin
    MyBoolean := ItemRec.Critical;
    MyVariant := MyBoolean;
    varResult := MyVariant.IsBoolean;
    Message(Text000,MyVariant,varResult);
    varResult := MyVariant.IsCode;
    Message(Text001,MyVariant,varResult);
end;
```
## Related information
variant-data-type
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/variant/variant-isboolean-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/variant/variant-isboolean-method/
