Data Masker

Masking Primary Key

Attempting to mask a Primary Key will fail if a Foreign Key is referencing it.

Usually, it is not necessary to mask a primary key, unless it contains sensitive data that requires masking. 

Whenever a Primary Key value is changed the related Foreign Key(s) must also be updated to maintain referential integrity.

If you receive a warning about, attempting to mask Primary Keys, the Data Masker rule in question will be invalid and fail when run.

To achieve Primary Key masking, you will need to create a Sync Manager Rule for each primary key. Use the following steps:

Step 1: Remove the primary key from the invalid substitution rule


Step 2: You need to create a Sync Manager Rule only for the PK, to do that you start by creating a new Substitution rule for the PK.

Then go to the Change Manager tab and click on Convert to Sync Manager


Step 3: Now you have the basis of a Sync Manager rule, you need to edit it to extend the scope, bringing in the FK related columns. 

Edit the Sync Manager rule, go to the Rule Generation By FK tab, select any FK relationship table on the right hand side, click the move button (as highlighted) to bring the selected table into the Sync tables list, and Update Sync Manager.


Step 4: If you have two rules running against the same table, you need to prevent them from running simultaneously.
To do that you need make the Sync. Manager rule dependent on your original substitution rule.

More on masking Primary Keys

This page explains how to use a sync manager rule to handle masking Primary Keys and related Foreign Keys.


If you also have items in other tables with an application inferred relationship with the Primary Key, please read our tech tip.



Didn't find what you were looking for?