Data masking lets us conceal sensitive information such as names and emails. This can be done during a data deployment or with in-place masking. The complexity of the production data still exists, but developers can't access real customer information.
Masking existing data in a sandbox
The quickest method to mask existing data in a sandbox is to use Gearset in-place masking. This can mask up to 9 million records per hour. See the Running your first in-place masking guide for a complete walkthrough.
Masking in a data deployment
Salesforce data masking is part of Gearset's sandbox seeding and data deployment products, so to get started we kick off a data deployment as usual by selecting the objects we want to deploy. In this example, we'll deploy some Account records and their related Contact records.
When we click Configure masking, we'll go to the data masking page. This shows the objects in the deployment with the fields that Gearset can mask. We also see a sample of the masked output for each field.
Masking can be turned on or off for individual fields. The filters on the left-hand side let us narrow down our selections to fields of a particular type. The list on the right allows us to make individual masking selections for each field.
Deployment
Once we're happy with the masking selections, we can go ahead with the deployment. In this example, we'll mask the FirstName, LastName and Email on the Contact object.
Then we can run the deployment.
We can see that the Contact in the source and the Contact in the target have different values for FirstName, LastName and email. The Contact is still attached to the correct Account, but all other details have been left identical.
This is from the source org:
This is from the target org:
Masking Localization
Both in-place masking and data deployments support Masking Localization. This feature is a drop-down menu that allows you to select a location that Gearset will base the new data on.
This will automatically affect the following field types -
City
Company name
Country
First name
Last name
Phone number
Postal code
Social Security Number or equivalent
State
State (abbreviated)
Street address
"State (abbreviated)" generates a state code for the masking locale, such as
AL for Alabama. Where a locale has no state data, Gearset falls back to the default locale, so the code may not match the masked Country. "State" behaves the same way.
Field masking methods
For most Salesforce field types, Gearset will provide a selection of masking methods that can be applied to them during deployment. They can be chosen through the mask method drop down:
For text fields that don't match any other types, we suggest using "Random text". This automatically maintains the same approximate length of real world values by using the length of the unmasked value to inform the length of the masked value.
For numerical fields that don't match any other types, choose "Integer" or "Double". This chooses a random number between the full range of values allowed by the field. If you want to preserve the approximate length of the values, use "Integer (similar size)" or "Double (similar size)".
For date fields, "Date" replaces the value with a completely random date. If you want masked dates to keep a realistic spread, use "Date (same month)" for a random date in the same month and year as the original, or "Date (same year)" for a random date in the same year. Both are offered for date fields only, and both fall back to a completely random date if Gearset can't read the original value.
"Date" is the most anonymizing of the three, so it stays the recommended default. "Date (same month)" and "Date (same year)" keep part of the original value on purpose.
Limitations
There are a few important caveats to data masking:
It's crucial to remember there's no rollback available for data deployment, so make sure you've taken a backup of any important data in the target org before you deploy.
Gearset won't let you mask data if the target is a production org, to help avoid costly deployment mistakes.
If an object is being upserted, then you can't mask the external ID field, because the upsert uses the value of that external ID field to match records.
If a masked field is empty on a record in the source, then the field will remain empty on the record in the target.








