Functions
Functions are used to anonymize data using a rule. Gigantics offers default functions that can be modified while editing the rule. The function options vary depending on the type of data contained in the table cell.
This is the list of available functions:
Mask
Masks the data into another value by transforming or replacing current data value. The options are:
Text transform (string/char)
Transforms the text value into the selected format.
Value | New value | ||
---|---|---|---|
None | foo bar | -> | foo bar |
Uppercase | foo bar | -> | FOO BAR |
lowercase | FOO Bar | -> | foo bar |
Title case | foo bar | -> | Foo Bar |
Snake case | foo bar | -> | foo_bar |
Kebab case | foo bar | -> | foo-bar |
Replace (any)
Replaces the selected value with a different one
Alphabetical chars / Digits / Symbols
Replaces each alphabetic character with a different character. This replacement can be partial or conditional:
- With: Select the character with which all alphabetic characters will be replaced:
Value | With | New value | |
---|---|---|---|
foo bar | x | -> | xxx xxx |
testing char | x | -> | xxxxxxx xxxx |
1234 | 0 | -> | 0000 |
1234753-H | 0 | -> | 0000000-H |
123.65 | , | -> | 123,65 |
$99 | £ | -> | £99 |
- Field length: Additionally, it allows you to change the length of the new
value. It can have 3 configurations:
- Initial: Keep the length of the current value.
- Random: Each field of the new value will have a different length than the original value.
- Fixed: All values will have the same length.
Type | Value | With | Length | New value | |
---|---|---|---|---|---|
Initial | foo bar | Y | - | -> | YYY YYY |
Initial | 123456 | 0 | - | -> | 000000 |
Initial | 859.939.292 | , | - | -> | 859,939,292 |
Random | testing char | Y | - | -> | YY YYYYYYY |
Random | 345 | 1 | - | -> | 1111 |
Fixed | new gigantics | Y | 2 | -> | YY YY |
Fixed | 4321 | 9 | 2 | -> | 99 |
- Condition: Adds a condition that allows to keep parts of the string or to
replace a substring.
- Keep: Select this option to keep the first or last X characters.
- Replace: Select this option to replace the first or last X characters.
Value | With | Condition | # Chars | New value | |
---|---|---|---|---|---|
foo bar | z | Keep first | 2 | -> | foz zzz |
foo bar | z | Keep last | 4 | -> | zoo bar |
testing char | z | Replace first | 1 | -> | zesting char |
new gigantics | z | Replace last | 3 | -> | new giganzzz |
Word
Replace full word to other new
Value | With | New value | |
---|---|---|---|
John | Test | -> | Test |
Sarah | Test | -> | Test |
Sarah Cruz | Test | -> | Test Test |
Regex
Replace chars/numbers/symbols using regex
Value | Regex | Replace with | New value | |
---|---|---|---|---|
test@email.com | .+?(?=@) | xxxx | -> | xxxx@email.com |
(+34) 603402022 | (?:00\|\+)\?[0-9]{2} | 0 | -> | (+00) 603402022 |
Field
Replace all field data to new value
Value | With | New value | |
---|---|---|---|
test multiple field | undefined | -> | undefined |
769C Honey Creek St. | Unamed Road | -> | Unnamed Road |
data:image/png;base64 | img | -> | img |
Shuffle
This function collects the column values and mixes them randomly.
Example:
Input:
- Shuffle column:
city
- Table:
Input:
# | street | city | state | |
---|---|---|---|---|
1 | debra.burks@yahoo.com | 9273 Thorne Ave. | Orchard Park | NY |
2 | kasha.todd@yahoo.com | 910 Vine Street | Forney | TX |
3 | tameka.fisher@aol.com | 769C Honey Creek St. | Redondo Beach | CA |
Output:
# | street | city | state | |
---|---|---|---|---|
1 | debra.burks@yahoo.com | 9273 Thorne Ave. | Forney | NY |
2 | kasha.todd@yahoo.com | 910 Vine Street | Redondo Beach | TX |
3 | tameka.fisher@aol.com | 769C Honey Creek St. | Orchard Park | CA |
Suffle group
This is a variant of shuffle where the selected fields are grouped together so that the selected fields are mixed in the same way and not each field independently.
Example:
Input:
- Shuffle group:
city
andstate
columns - Table:
# | street | city | state | |
---|---|---|---|---|
1 | debra.burks@yahoo.com | 9273 Thorne Ave. | Orchard Park | NY |
2 | kasha.todd@yahoo.com | 910 Vine Street | Forney | TX |
3 | tameka.fisher@aol.com | 769C Honey Creek St. | Redondo Beach | CA |
4 | daryl.spence@aol.com | 988 Pearl Lane | Uniondale | NY |
Output:
# | street | city | state | |
---|---|---|---|---|
1 | debra.burks@yahoo.com | 9273 Thorne Ave. | Redondo Beach | CA |
2 | kasha.todd@yahoo.com | 910 Vine Street | Uniondale | NY |
3 | tameka.fisher@aol.com | 769C Honey Creek St. | Forney | TX |
4 | daryl.spence@aol.com | 988 Pearl Lane | Orchard Park | NY |
List
Select a random value from a list. The lists available here are created from the Datasets area of the project configuration items. If the number of records is greater than the number of records in the dataset, the values will be repeated.
Example:
Input:
- Column: fruit
- Dataset: [Banana, Apple, Pear]
- Table:
# | fruit | price |
---|---|---|
1 | Pineapple | $0.60 |
2 | Strawberry | $0.40 |
3 | Coconut | $2.95 |
Output:
# | fruit | price |
---|---|---|
1 | Pear | $0.60 |
2 | Banana | $0.40 |
3 | Apple | $2.95 |
Delete
This function will NULL the selected column. This function can’t be used on columns which are specified as NOT NULL.
Example:
Input:
- Delete column:
price
- Table:
# | fruit | price |
---|---|---|
1 | Pineapple | $0.60 |
2 | Strawberry | $0.40 |
3 | Coconut | $2.95 |
Output:
# | fruit | price |
---|---|---|
1 | Pear | NULL |
2 | Banana | NULL |
3 | Apple | NULL |
Blank
Remove the value of the field.
Example:
Input:
- Delete column:
price
- Table:
# | fruit | price |
---|---|---|
1 | Pineapple | $0.60 |
2 | Strawberry | $0.40 |
3 | Coconut | $2.95 |
Output:
# | fruit | price |
---|---|---|
1 | Pear | |
2 | Banana | |
3 | Apple |