# Array JSON Mask

This is a [composite generator](https://docs.tonic.ai/app/generation/generators/generator-types/generators-composite).

A version of the [JSON Mask](https://docs.tonic.ai/app/generation/generators/generator-reference/json-mask) generator that can be used for array values.

Runs a selected generator on values that match a user-specified [JSONPath](https://goessner.net/articles/JsonPath/index.html#e2).

## Characteristics <a href="#array-json-mask-characteristics" id="array-json-mask-characteristics"></a>

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"><strong>Consistency</strong></td><td valign="top">Determined by the specified sub-generators.</td></tr><tr><td valign="top"><strong>Linking</strong></td><td valign="top">Determined by the specified sub-generators.</td></tr><tr><td valign="top"><strong>Differential privacy</strong></td><td valign="top">Determined by the specified sub-generators.</td></tr><tr><td valign="top"><strong>Data-free</strong></td><td valign="top">Determined by the specified sub-generators.</td></tr><tr><td valign="top"><strong>Allowed for primary keys</strong></td><td valign="top">No</td></tr><tr><td valign="top"><strong>Allowed for unique columns</strong></td><td valign="top">No</td></tr><tr><td valign="top"><strong>Uses format-preserving encryption (FPE)</strong></td><td valign="top">No</td></tr><tr><td valign="top"><strong>Privacy ranking</strong></td><td valign="top">5</td></tr><tr><td valign="top"><strong>Generator ID (for the API)</strong></td><td valign="top"><a href="../../../api/quick-start-guide/tonic-api-generator-assignment/generator-api-reference/generator-api-ref-array-json-mask"><code>ArrayJsonMaskGenerator</code></a></td></tr></tbody></table>

## How to configure <a href="#array-json-mask-configure" id="array-json-mask-configure"></a>

### Adding a sub-generator <a href="#array-json-mask-add-sub-generator" id="array-json-mask-add-sub-generator"></a>

To assign a generator to a path expression:

1. Under **Sub-generators**, click **Add Generator**.\
   \
   On the sub-generator configuration panel, the **Cell JSON** field contains a sample value from the source database. You can use the previous and next icons to page through different values.
2. In the **Path Expression** field, type the JSONPath expression to identify the value to apply the generator to.\
   \
   To populate a path expression, you can also click a value in the **Cell JSON** field.\
   \
   **Matched JSON Values** shows the result from the value in **Cell JSON**.
3. By default, the selected generator is applied to any value that matches the expression.\
   \
   To limit the types of values to apply the generator to, from the **Type Filter**, specify the applicable types. You can select **Any**, or you can select any combination of **String**, **Number**, and **Null**.
4. From the **Generator Configuration** dropdown list, select the generator to apply to the path expression.\
   \
   You cannot select another composite generator.
5. Configure the selected generator.\
   \
   You cannot configure the selected generator to be consistent with another column.
6. To save the configuration and immediately add a generator for another path expression, click **Save and Add Another**.\
   \
   To save the configuration and close the add generator panel, click **Save**.

### Managing the sub-generator list <a href="#array-json-mask-manage-sub-generators" id="array-json-mask-manage-sub-generators"></a>

From the **Sub-Generators** list:

* To edit a generator assignment, click the edit icon.
* To remove a generator assignment, click the delete icon.
* To move a generator assignment up or down in the list, click the up or down arrow.

### Enabling data encryption <a href="#array-json-mask-data-encryption" id="array-json-mask-data-encryption"></a>

If [Structural data encryption](https://docs.tonic.ai/app/generation/generators-assign-config/generators-data-encryption-config) is enabled, then to use it for this column, in the advanced options section, toggle **Use data encryption process** to the on position.
