Skip to main content

Data masking didn't deploy as many records as expected

During a data masking deployment, not as many records were masked as there are records for an object

Vincent Maltby avatar
Written by Vincent Maltby
Updated this week

During a data masking deployment, upon completion you may see that the job completes successfully, but that less records were masked than you were expecting.

For example, you have 114 Accounts, and you select to mask the Account object.

You only select a few fields to be masked from that object.

Upon completion, you see that only 11 out of your 114 Accounts have been masked.

This is due to only those 11 Accounts that were masked having maskable data for the fields that have been selected to be masked.

Also note, that if the field is empty, data will not be added, the masking facility will only mask existing data and not create data for blank/empty fields.

If you would like to double check the number of records masked is because it was only that many records that contained data, you can run a SOQL query on your org to check this.

SELECT 
[Insert API Name of the field you are masking],
[Insert the API Name of the final field you are masking]
FROM [Insert name of parent object, Account for example]
WHERE
[Add the API name of the field you are masking] != null OR
** clone the above line as many times as needed to include all the fields being masked **
[Add the API name of the final field you are masking] != null

For my masking deployment example in the screenshot above the SOQL is:

SELECT BillingCity,
DunsNumber,
Jigsaw,
NaicsCode,
NaicsDesc,
RecordTypeId,
Description
FROM Account
WHERE
BillingCity != null OR
DunsNumber != null OR
Jigsaw != null OR
NaicsCode != null OR
NaicsDesc != null OR
RecordTypeId != null

You'll notice that I have not included Description in the Where clause, as it is a text field and cannot be returned in the query. You may need to remove field from the Where clause in the query for fields that cannot be returned inside a Where clause.

This is the result for my query, and we can count that there are 11 records that contain information that can be masked, and so therefore only 11 records will be masked, which was the result of my data masking deployment.

Did this answer your question?