Missing, null and wrong-type data
What the document shows when data is absent. Data and expressions in the DocStudio designer user guide.
Real data is often incomplete. DocStudio decides what to show with a missing-data policy that you set in the page settings.
What counts as what
| Data | Text binding | Result |
|---|---|---|
| Key not present | missing | Policy applies |
null |
null | Treated like missing |
"" (empty text) |
empty | Shown as empty text, no problem |
| Text, number, boolean | present | Shown (0 and false are shown) |
| List or object in a text | wrong type | Reported |
For lists (repeaters and tables) an empty list is valid: it shows the empty state. A text where a list is expected is a wrong type.
Policies
Set missingData in the Page group:
| Policy | Shows | Problem raised |
|---|---|---|
blank |
Nothing | None |
placeholder (default) |
A dash | None |
warn |
Nothing | Warning MISSING_DATA |
error |
Nothing | Error MISSING_DATA |
Use placeholder while designing so gaps are visible, warn or error when generating production documents so missing data is noticed.
Wrong type
A wrong-type value always raises a warning (an error under the error policy). Under placeholder it shows a dash.
Fallbacks
A path can have a fallback that is used only when the value is missing. null, empty text, 0 and false are real values and are not replaced.
Try it
The Data tab has a Missing data preview table that shows how each case behaves under the current policy.
See also Data shows a dash or nothing.