# Random Boolean (RandomBooleanGenerator)

The [Random Boolean](https://docs.tonic.ai/app/generation/generators/generator-reference/random-boolean) generator assigns a random boolean value.

## Link object structure <a href="#generator-api-random-boolean-link-object" id="generator-api-random-boolean-link-object"></a>

The Random Boolean generator does not support linking or consistency. You cannot configure differential privacy.

The `metadata` object is populated from the [`RatioMetadata`](https://app.tonic.ai/apidocs/index.html#/models/RatioMetadata) object. The `ratio` field indicates the percentage (as a decimal value between 0 and 1.0) of values to set to `true`.

```json
{
  "schema": "string",
  "table": "string",
  "column": "string",  
  "path": "string",  //JSON fields only
  "dataType": "string",  //MongoDB, Amazon DynamoDB, and JSON fields only
  "metadata": {
    "presetId": "string",
    "generatorId": "RandomBooleanGenerator",
    "ratio": numeric,
    "encryptionProcessor": "x-on", //To use configured Structural data encryption
    "customValueProcessor": "string"  //If custom value processor applied
  }
}
```

## Example replacement <a href="#generator-api-random-boolean-replacement" id="generator-api-random-boolean-replacement"></a>

In the following example replacement for the Random Boolean generator, 40% of the destination values are `true`, and 60% are `false`.

```json
{
  "name": "is-available",
  "schema": "public",
  "table": "products",
  "links": [
    {
      "schema": "public",
      "table": "products",
      "column": "is-available",
      "metadata": {
        "presetId": "RandomBooleanGenerator",
        "generatorId": "RandomBooleanGenerator",
        "ratio": 0.4
      }
    }
  ]
}
```
