ℹ️ This article is for advanced users editing template JSON directly. Most template changes — adding fields, updating labels, adjusting layout — can be made through the standard template editor UI or with Storm in the Template Editor. Raw code editing is typically only needed for complex structural changes or bulk edits.
How is a Dashpivot template JSON structured?
A Dashpivot template is a JSON object. The raw code view exposes two editable fields — orientation and items — while the full internal object includes additional metadata fields validated on save.
When you open the raw code view in the Template Editor, you see the editable portion of the template JSON — orientation and the items array. Metadata like the template name and state is managed by the UI.
The full internal template object has additional required fields validated on save. These are listed below for reference when working with the raw JSON directly (e.g., via Claude or API tooling).
Fields visible in the raw code view
Field | Type | Notes |
|
| PDF export orientation. Defaults to |
| array | The template's fields. Must contain at least 1 item. |
Full internal required fields (for reference)
The complete template object includes additional fields validated on save. These are relevant when working with the raw JSON via Claude or API tooling:
Field | Type | Notes |
| string | The template's display name. Min 1 character. No |
| string | Internal identifier for the template. Same character restrictions as |
| string | Label used for forms created from this template (e.g. "Inspection Report"). Same restrictions. |
| enum | Must be |
| array | The template's fields. Must contain at least 1 item. A template with zero fields is invalid. |
| array | Workflow/status columns. Each entry has a |
| string[] | MongoDB ObjectId strings for the template's folder hierarchy. |
Common optional fields
Field | Type | Purpose |
| array | Fields rendered in PDF header/footer (logo, page numbers, filepath, etc.) |
|
| PDF export orientation. Defaults to portrait. |
| number | Formula engine version used by this template. |
| string | Custom filename pattern for exported PDFs. |
| array | Default fill values for form fields. |
| boolean | Enables AI form-fill for this template. |
| boolean | Locks the template from editing after creation. |
What are the naming and ID rules for template fields?
Every field requires three string identifiers (name, uniqueAppId, instanceName) and a MongoDB-format _id. All four must be non-empty, free of reserved characters, and follow the formats below.
String fields (name, uniqueAppId, instanceName)
All three string fields share the same validation:
❌ Cannot contain a forward slash /
❌ Cannot contain a backslash \
❌ Cannot be whitespace-only
Field IDs (_id and id)
Each field in items requires a _id. Two formats are in use:
Format | Example | Notes |
MongoDB ObjectId |
| 24-character hex string. Used for |
FlakeID |
| System-assigned. Prefixed by type: |
⚠️ Do not manually construct or guess FlakeID values. Use IDs copied from an existing valid template or let the editor generate them. _id and id should always carry the same value — id is a legacy duplicate of _id.
The kind field
Every field has a kind property that acts as its type discriminator. Older field kinds use camelCase; newer ones use kebab-case. Both are valid — do not convert between them.
What field types can I use in the raw code editor?
The kind field controls what type of input a field renders. There are 27 supported values — use them exactly as written, since they are case-sensitive and any unrecognised value will fail validation.
The following kind values are supported. These are case-sensitive — use them exactly as written.
"actions"— Action tracking"attachment"— File attachment"category"— List / dropdown"counter"— Auto-increment counter"date"— Date/time with timezone"datePlain"— Plain date"dateRangePlain"— Plain date range"location"— GPS location"multiLineInput"— Multi-line text"pageBreak"— Page break"person"— User picker"photo"— Photo capture"prefilledTable"— Table with prefilled rows"preFilledText"— Static text label"relationship"— Cross-form link"repeatingGroup"— Repeating container"signature"— Single signature"signatureArray"— Multiple signatures"signonTable"— Sign-on / ID scan table"singleLineInput"— Single-line text input"sitemate-profile"— Sitemate profile"sitemate-wallet"— Sitemate wallet"sketch"— Freehand drawing"source"— Source metadata"table"— Data table"weather-table"— Weather measurements"yesNoCheckbox"— Yes / No / N/A
ℹ️ All fields share a base shape: _id (required), kind (required), description (optional label), isRequired, readOnly, isHiddenInFormPDFExports, isExcludedInFormCloning, and dependsOn for conditional logic.
Common per-type required properties
kind | Required properties |
|
|
|
|
|
|
|
|
|
|
|
|
ℹ️ All fields share a base shape: _id (required), kind (required), description (optional label), isRequired, readOnly, isHiddenInFormPDFExports, isExcludedInFormCloning, and dependsOn for conditional logic.
What are the limits when editing template JSON?
Repeating groups can have a maximum of 10 child fields and 10 instances, with only one level of nesting allowed. Exceeding these limits will prevent the template from saving.
Repeating groups
Limit | Value |
Max child field definitions per repeating group | 10 |
Max instances (filled copies) per repeating group | 10 |
Nesting depth | 1 level only — child fields of a repeating group cannot themselves be containers |
Table references in formulas
Tables in formulas are referenced by their tableReference value (e.g., Table1, Table2). If two tables in the same template share the same tableReference, formula expressions become ambiguous and will not evaluate correctly.
⚠️ Every table field in a template must have a unique tableReference value. Duplicate references will cause formula errors that may be difficult to diagnose.
The items array
The top-level items array must contain at least one field. An empty items: [] array will fail validation on save.
What characters and keywords should I avoid in template JSON?
Avoid forward slashes, backslashes, and whitespace-only strings in name fields. Deprecated colour values (info, success, warning, danger) must be replaced with their current equivalents — using them will cause a validation error.
In name, uniqueAppId, and instanceName
❌ Cannot contain a forward slash /
❌ Cannot contain a backslash \
❌ Cannot be whitespace-only
These characters are used internally as path separators in the folder and template hierarchy. Including them in a name or ID corrupts the path structure, which can cause the template to become unreachable or break folder navigation. A whitespace-only string fails validation because Dashpivot requires all display names to have
meaningful, non-empty content.
Reserved kind values
All 27 kind values listed above are reserved by the Dashpivot field type system. Each one maps to a specific field renderer, validation schema, and data model. If you use an unrecognised kind value, the template editor will reject the field with an "Invalid kinds used in raw code" error and block saving. If you use a recognised kind with the wrong required properties, the field will either save in a broken state or fail validation depending on how strictly that type is checked.
Do not invent custom kind values or repurpose existing ones for a different field type — each kind is tightly coupled to its renderer and data structure.
Reserved ID prefixes
Dashpivot uses a FlakeID system to generate unique IDs for different entity types. Each prefix identifies what kind of object the ID belongs to:
Prefix | Entity type |
| Template (app) |
| Form item / field |
| Table property |
| Prefilled table property |
| Workspace |
| Project |
| List item |
| List property |
These prefixes are generated by the system and encode both the entity type and a timestamp-based unique value. Do not manually construct, guess, or copy these across entities — a duplicated or hand-written FlakeID will either collide with an existing object or be rejected by the ID format validator.
Path fields
Two fields on the template object store its location in the workspace hierarchy:
Field | Format | Purpose |
|
| Modern FlakeID-based path used by the current API for folder traversal and permissions |
|
| Legacy MongoDB ObjectId-based path, kept for backwards compatibility |
Both paths are computed and maintained by the system whenever a template is moved, renamed, or saved. Manually editing either value will desync the template from its actual location in the folder tree, which can break folder navigation, permissions, and form register queries. Leave these fields untouched when editing raw code.
Example: What does a valid template JSON look like?
This is what the raw code view in the Dashpivot Template Editor looks like. The editor exposes orientation and the items array — metadata fields like name and state are managed by the UI, not in the raw code view.
{
"orientation": "portrait",
"items": [
{
"_id": "507f191e810c19729de860ea",
"id": "507f191e810c19729de860ea",
"kind": "singleLineInput",
"description": "Site name",
"content": "",
"isRequired": true,
"indentation": "default"
}
]
}
ℹ️ Notice that _id and id typically carry the same value — id is a legacy duplicate of _id. Both should be present and match when editing an existing field.
ℹ️ The template editor uses schema passthrough for most field types — unknown extra properties are tolerated rather than rejected. However, strictly validated fields (such as date and preFilledText) will fail on type mismatches.
Frequently asked questions
Why does the template show "Invalid kinds used in raw code" and won't save?
Every field in the items array must have a valid kind property. This error means one or more fields is either missing kind entirely, or has a value that doesn't match a supported type.
🔧 How to fix it: Open Raw Code and look for any field object that is missing a "kind" key or has a typo in the kind value. Compare against the supported field types listed above. If the bad field came from an older template copy, remove or correct it before saving.
I pasted full template JSON into the raw code view but my orientation setting didn't apply — why?
The raw code toggle only imports the items array (the field definitions). Template-level settings like orientation, columns, and exportFilenameFormat are managed separately by the UI and are not applied when pasting raw code.
🔧 How to fix it: Set orientation and other template-level settings via the template editor UI settings panel, not through the raw code view.
The template won't save after I edited the raw code — no error message shown. What should I check?
A common cause is stale Display on Form Thumbnail references. If raw code edits removed or renamed fields that were previously selected under Template Settings → Display on Form Thumbnail, the save will be blocked because the setting still references fields that no longer exist.
🔧 How to fix it: Go to Template Settings → Display on Form Thumbnail, reset the dropdowns, and save.
I'm getting an error about invalid _id or id values. What format do they need to be in?
Field IDs must be valid MongoDB ObjectId strings — 24 hexadecimal characters (e.g. 507f191e810c19729de860ea). The template editor validates this format on save and will reject IDs that don't match. Common mistakes include copying a FlakeID (fi_xxx) into the _id field, or manually writing a short or non-hex string.
🔧 How to fix it: Copy a valid _id from an existing field in the same template. Make sure both _id and id carry the same value.
A category field or list table column is showing a colour error when saving. How do I fix it?
Older templates may contain deprecated colour values ("info", "success", "warning", "danger") on category field items or list table columns. If you encounter them in raw code, replace them manually:
"info"→"sky""success"→"green""warning"→"yellow""danger"→"red"
