DDS Syntax (Datadance Syntax)
DDS (Datadance Syntax) is a YAML-like alternative to writing transforms in JSON. It is more concise and readable, especially for complex transformations.
Writing transforms in DDS
Each line defines one transform: a field name followed by a colon and the expression.
field1: expression1
field2: expression2
Example
- JSON
- DDS
[
{ "fullName": "input.first + ' ' + input.last" },
{ "age": "input.age | parseInt" }
]
fullName: input.first + ' ' + input.last
age: input.age | parseInt
Using DDS with the API
Set transforms_syntax: "dds" in the settings and pass the transforms as a string:
{
"input": { "first": "Alice", "last": "Smith", "age": "30" },
"transforms": "fullName: input.first + ' ' + input.last\nage: input.age | parseInt",
"settings": { "merge_method": "overwrite", "transforms_syntax": "dds" }
}
Nested transforms in DDS
Indentation (2 spaces) defines nesting:
- DDS
- Equivalent JSON
address:
street: upper(input.address.street)
city: upper(input.address.city)
[
{
"address": [
{ "street": "upper(input.address.street)" },
{ "city": "upper(input.address.city)" }
]
}
]
Rules
| Rule | Detail |
|---|---|
| Indentation | Must be in multiples of 2 spaces (no tabs) |
| Field names | Only alphanumeric, underscores, and dollar signs |
| String literals | Use single quotes, not double quotes |
| Values without colon | Creates a nested transform block |
Converting between formats
Use the dedicated endpoints for conversion:
- DDS → JSON:
POST /api/parsewith DDS text as the body - JSON → DDS:
POST /api/encodewith JSON transforms as the body