Mask Canadian Social Insurance Numbers

The mask Canadian Social Insurance Numbers policy generates a random Canadian Social Insurance Number (SIN) that includes the first three digits of the source value.

JavaScript policy syntax

This policy is available with the functions SINMask.randomSIN() and SINMask.maskSIN().

To generate a random value not based on an input value, use the function: SINMask.randomSIN()

To generate a value based on an input value, use the function: SINMask.maskSIN(record.getItem('<arg.inputAttribute>'))

For example, to generate a random value based on an input value, use the following:

SINMask.maskSIN(record.getItem('/DEMO/CUSTOMERS/NATIONAL_ID'))

To generate a value based on the input value and mask an additional attribute in which all instances of the input value are masked, use the function: SINMask.maskSIN(record.getItem('<arg.inputAttribute>'), '<arg.additionalAttribute>')

For example, to generate a value based on the NATIONAL_ID attribute and mask additional instances of the input value found in the CUST_ID attribute, use the following:

SINMask.maskSIN(record.getItem('/DEMO/CUSTOMERS/NATIONAL_ID'), '/DEMO/CUSTOMERS/CUST_ID')

Argument Description
inputAttribute The attribute containing the input value to mask.
additionalAttribute The additional attribute in which all instances of the input value are masked.