> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Bool data type

The logical or boolean data type of CRMScript is **Bool**.

Variables of this type can only have 2 values: **true** or **false** and are commonly used in comparisons and conditional statements.

Aside from testing the value, you can't do much except to convert it to a number or a string.

<Note>
  You can create arrays of any data type to store more than one value at the same time like this: `String[] s1;`. For a given array, all items must be of the same type. Read more about [looping and accessing array items][1] in the fundamentals section.
</Note>

[1]: ../../fundamentals/arrays

## Constructors

### Bool Bool(Bool value)

Pass a `Bool` to copy into a new object.

```crmscript! theme={null}
Bool isWellFormed = true;
Bool isValid = Bool(isWellFormed);
Bool isCertified = Bool(false);
printLine("Valid: " + isValid.toString() + "\t Certified: " + isCertified.toString());
```

## Integer toInteger()

Will return an integer representation of the boolean value.

False equals 0 and true equals 1.

```crmscript! theme={null}
Bool b = true;
printLine(b.toInteger().toString());
```

In this example, we 1st call `toInteger()` to convert the Bool to an Integer, and then we call `toString()` *on the Integer* to get a printable string. Notice the difference between this and the next example.

## String toString()

`toString()` is one of the most frequently used methods, typically when you are going to output something. It returns a string representation of a Bool.

```crmscript! theme={null}
Bool b = true;
printLine(b.toString());
```


## Related topics

- [Integer data type](/en/automation/crmscript/datatypes/integer-type.md)
- [Generic data type](/en/automation/crmscript/datatypes/generic-type.md)
- [Map data type](/en/automation/crmscript/datatypes/map-type.md)
- [String data type](/en/automation/crmscript/datatypes/string-type.md)
- [Introduction to data types](/en/automation/crmscript/fundamentals/datatypes-intro.md)
- [Float data type](/en/automation/crmscript/datatypes/float-type.md)
