Conditional datasets
Published 02 September 2025
This is a dynamic masking dataset that applies different data transformation rules based on configurable conditions.
It evaluates boolean expressions against data fields and selects appropriate datasets for masking based on the evaluation results.
Structure
{
"name": "string",
"type": "Conditional",
"conditions": [
{ "if": "boolean_expression", "then": "dataset_name" },
{ "if": "boolean_expression", "then": "dataset_name" },
{ "otherwise": "default_dataset_name" }
]
}Properties
- name (string, required): Unique identifier for the conditional dataset
- type (string, required): Must be "Conditional"
- conditions (array, required): Array of condition objects that define the evaluation logic
Condition objects
If-Then Conditions
{ "if": "boolean_expression", "then": "dataset_name" }- if (string, required): Boolean expression that evaluates to true or false
- then (string, required): Name of the dataset to use when the condition is true
- required: At least 1 if-then condition must exist in a conditional dataset.
Otherwise
{ "otherwise": "default_dataset_name" } - otherwise (string, required): Default dataset used when no if-conditions evaluate to true
- required: Exactly 1 otherwise condition must exist in a conditional dataset.
Expression Syntax
Referencing the current value
- Use
${value}to reference the value currently being masked
Referencing the value of a field
- Use
$[FieldName]to reference column values - Example:
$[Type],$[CustomerName] - Note: Using a field will only work for datasets defined at the table level, it is not possible to define a global level dataset that uses a field.
Operators
Comparison Operators
| Operator | Description |
|---|---|
== | Equals |
!= | Not equals |
< | Less than |
> | Greater than |
<= | Less than or equal |
>= | Greater than or equal |
Logical Operators
| Operator | Description |
|---|---|
&& | Logical AND |
|| | Logical OR |
! | Logical NOT |
Example configuration using conditional datasets
{
"tables": [
{
"schema": ...,
...,
"datasets": [
{
"name": "Towns",
"type": "Conditional",
"conditions": [
{ "if": "$[Country] == \"France\"", "then": "FrenchCities" },
{ "if": "$[Country] == \"Germany\"", "then": "GermanCitites" },
{ "otherwise": "Cities" }
]
}
]
}
]
}This documentation contains proprietary information and is protected by copyright law.
Copyright © 2026 Red Gate Software Limited. All rights reserved