Replace characters

The replace characters policy masks each character in a string with a randomly generated character that matches the type of character that is replaced. For example, numbers are replaced with numbers, and lowercase letters are replaced with lowercase letters. The characters used for masking are obtained from a specified character set. The policy masks characters that are part of the character set only.

JavaScript policy syntax

This policy is available with the function ScrambleMask.replaceCharacters().

ScrambleMask.replaceCharacters(record.getItem('<arg:inputAttribute>'),'<arg:language>')

For example, to replace values in a string with characters from an English character set, enter the following syntax:

ScrambleMask.replaceCharacters(record.getItem('/DEMO/ORDERS/ORDER_ID'),'English')

Argument Description
inputAttribute The attribute containing the string to mask.
language The language for the character set that provides the characters used for masking. If a character set is not specified, or if the character set is not supported, the English character set is used. For a list of supported character sets, see Language character sets supported for scramble mask policies.