> For the complete documentation index, see [llms.txt](https://docs.flosum.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flosum.com/data-migrator/templates/template-designer/applying-data-masking-to-fields.md).

# Applying Data Masking to Fields

## ![](https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FcfMTqg4Brbm9baWutclZ%2FSummary2-Small-Icon.svg?alt=media\&token=d1cf162d-c02d-4184-988e-7f7350e450fc) Overview

This article explains what Data Masking is and how to apply it to specific fields to prevent sensitive data from being migrated to the target organization. Data Masking is useful in sandbox or testing environments where real customer information should never be exposed. By selectively masking fields, teams can maintain realistic data structures for validation while ensuring compliance with data privacy requirements.

### How Data Masking Works

Data Masking replaces a field's value with randomized data during a migration. The masking process follows these steps:

1. Records are retrieved from the source org.
2. If data masking is **enabled** for a field, the value is replaced with a randomly generated value of the same field type, with valid formatting.
3. If data masking is **disabled** for a field, the original value remains unchanged.
4. Records with masked fields are deployed to the target org.

{% hint style="info" %}
Masking is performed dynamically during the migration and occurs before data is written to the target environment. For masked fields, the original value is replaced with a randomized value not derived from the source data, so the original value cannot be determined.
{% endhint %}

### Data Mask States

The table below shows the different Data Mask State icons, with an explanation of each.

<table><thead><tr><th width="160.33331298828125">State</th><th width="80.33331298828125">Icon</th><th>Description</th></tr></thead><tbody><tr><td><strong>Unmasked</strong></td><td><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FC3SG98ZpzVUvfwiB57aS%2FAppyingDataMasking-State-Unmasked.png?alt=media&amp;token=531af0de-3fb6-4a85-a8e7-a383e1b2b886" alt=""></td><td>The source data for this field will be migrated.</td></tr><tr><td><strong>Masked</strong></td><td><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FtFFa2XcoU6u0AUwAjy2d%2FAppyingDataMasking-State-Masked.png?alt=media&amp;token=b9cd5b0e-632d-4c76-bdff-f17f8d8ddf10" alt=""></td><td>Masked data for this field will be migrated.</td></tr><tr><td><strong>Non-Maskable</strong></td><td><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2F5kt9c3BeBEQMSNCD04Ot%2FAppyingDataMasking-State-Non-Maskable.png?alt=media&amp;token=385a6f47-882d-4cb7-899b-01004a6261f1" alt=""></td><td>This field's data can not be masked, and the source data for this field will always be migrated.</td></tr></tbody></table>

## Apply Data Masking

{% stepper %}
{% step %}

### Select Template

1. Click **Templates** from the left sidebar menu.
2. Click the template to add Data Masking to.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FI6U0hz6jUb55uBCTi2xH%2FAppyingDataMasking-S01-01.png?alt=media&amp;token=a60d6468-dde0-4743-a18b-14e7366fcad7" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Apply Data Masking

1. Click the object to apply Data Masking to.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FzIcwfE7pFXAuaSfbGW82%2FAppyingDataMasking-S02-01.png?alt=media&amp;token=90885798-3945-4b2a-9a7b-3bd56630b1f4" alt="" width="563"><figcaption></figcaption></figure></div>
2. Click the **Eye** icon of the field to mask.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FDF6r3GKVJ1jCbjnac09L%2FAppyingDataMasking-S02-02.png?alt=media&amp;token=ebf6acd1-f232-44fe-b92f-85faabae4fc4" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
See the **Data Mask States** section above for an explanation of each **Eye** icon.
{% endhint %}

3. Click **Add Masking**.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FddcjXekRvKGMNjoB9R6o%2FAppyingDataMasking-S02-03.png?alt=media&amp;token=55c445f9-9663-4410-bcb6-ae7dcdae312d" alt="" width="563"><figcaption></figcaption></figure></div>
4. Click the **Data Masking Method** dropdown menu.
5. Select the masking method to use.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2Fav5shlYyGeSDfl8h6y9P%2FAppyingDataMasking-S02-04.png?alt=media&amp;token=aa0a2a43-a5d4-402b-a393-6f3c16758a9e" alt="" width="563"><figcaption></figcaption></figure></div>

{% hint style="info" %}
Currently, the only masking method available is **Random**. This method generates random data for the mask during migration.
{% endhint %}

6. Click **Back**. Note that clicking the **X** will discard the Data Mask.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FtHvxWeJTmccf2h8v3aTM%2FAppyingDataMasking-S02-05.png?alt=media&amp;token=039afbe0-6401-44c3-9681-b07ae06288ac" alt="" width="563"><figcaption></figcaption></figure></div>
7. The Data Mask State icon shows that the field is now masked.
8. Click **Save** once all Data Masks have been applied.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FgLYhC4c1ZujnH0Hz9fpH%2FAppyingDataMasking-S02-06.png?alt=media&amp;token=d5333427-fb7d-48a4-a415-d068f7042ca0" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Remove Data Masking

1. Click the object to remove Data Masking from.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FIWn05uNeL4hCgixE6Mal%2FAppyingDataMasking-S03-01.png?alt=media&amp;token=8ff46232-c6b7-4e2e-93c9-c19c4ed4e117" alt="" width="563"><figcaption></figcaption></figure></div>
2. Click the **Eye** icon of the field to remove Data Masking.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FpPBVi5sfyOfx6cO5cEiz%2FAppyingDataMasking-S03-02.png?alt=media&amp;token=949d7e70-4af6-4540-9b23-7dc9977706d9" alt="" width="563"><figcaption></figcaption></figure></div>
3. Click the **Remove** icon to the right of the masking method.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2Fj272oPAoUcz6wW6aeiKB%2FAppyingDataMasking-S03-03.png?alt=media&amp;token=6db974fe-e1ae-4daa-9441-21c6fe59b6a4" alt="" width="563"><figcaption></figcaption></figure></div>
4. Click **Back**. Note that clicking the **X** will leave the Data Mask unchanged.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FRKELUhae4qsZfM9KCKvV%2FAppyingDataMasking-S03-04.png?alt=media&amp;token=c4155021-c503-4240-8fd2-8786aa1c4e21" alt="" width="563"><figcaption></figcaption></figure></div>
5. The Data Mask State icon shows that the field is now unmasked.
6. Click **Save** once the desired Data Masks have been removed.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FBslLabMXSrk4qlcF7faV%2FAppyingDataMasking-S03-05.png?alt=media&amp;token=403adbc1-5635-4d05-abf3-320997abb4b9" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}

{% step %}

### Save Template

Once you are done applying or removing Data Masking to fields:

1. Click **Save template** to save your changes.

   <div align="left"><figure><img src="https://2769999621-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FvaxzColPOlNbsq4imqpd%2Fuploads%2FpJCYO051RUNiHvGvST9a%2FAppyingDataMasking-S04-01.png?alt=media&amp;token=7592baaa-9da0-435d-9420-324f3b3fa6d7" alt="" width="563"><figcaption></figcaption></figure></div>

{% endstep %}
{% endstepper %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flosum.com/data-migrator/templates/template-designer/applying-data-masking-to-fields.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
