In this article
1: Summary
Use Mapping CDL to rename or restructure survey content when combining multiple surveys or standardizing schema across projects. The mapping autocombined entity supports mapping:
Questions
Loops
Items (e.g., grid prompts, lists, response options)
This mapping ensures consistency across surveys even if internal naming differs.
2: Declaring a Mapping CDL Block
mapping autocombined #auto {
mapping survey {
surveys: "survey1", "survey2"
// mapping logic here
}
}2.1: Key Properties
| Property | Description |
surveys | A list of survey IDs or names that this mapping applies to. |
mapping question | Maps question names (IDs). |
mapping loop | Maps loop names. |
mapping item | Maps specific objects (e.g., question options, lists, grid prompts). |
3: Mapping Questions
Renames questions from one schema to another:
mapping question {
mapping {
from: "gender"
to: "sex"
}
}This remaps question identifiers during data merge or transformation.
4: Mapping Loops
Remaps loop entity names:
mapping loop {
mapping {
from: "location"
to: "place"
}
}5: Mapping Items
Items include questions, gridPrompts, gridScales, lists, and loops.
5.1: Example: Mapping Question Options
mapping item {
questions: "sex"
mapping {
from: "gender"
to: "sex"
}
}5.2: Example: Mapping Grid Prompts
mapping item {
gridprompts: "mygrid"
mapping {
from: "one"
to: "1"
}
mapping {
from: "two"
to: "2"
}
}5.3: Example: Mapping Lists
mapping item {
lists: "list1"
mapping {
from: "yes"
to: "1"
}
mapping {
from: "no"
to: "0"
}
}5.4: Example: Mapping Loop Items
mapping item {
loops: "l1"
mapping {
from: "location"
to: "place"
}
}6: Full Example
mapping autocombined #auto {
mapping survey {
surveys: "p123", "p456"
mapping question {
mapping {
from: "gender"
to: "sex"
}
}
mapping loop {
mapping {
from: "location"
to: "place"
}
}
mapping item {
gridprompts: "mygrid"
mapping {
from: "oldPrompt"
to: "newPrompt"
}
}
mapping item {
lists: "orgList"
mapping {
from: "yes"
to: "1"
}
}
}
}7: Best Practices
Use consistent
tonames across surveys when standardizing.Avoid ambiguous or overlapping mappings—each
frommust be unique.Use
mapping itemfor deeper customization (e.g., specific grid rows).When mapping lists, always double-check that values align logically.