Document Preview
See a real-time preview of the MongoDB document that will be created from your form data.
How It Worksโ
As you fill in form fields, the Document Preview panel shows the resulting document structure. This helps you verify that your form produces the correct data format for your MongoDB collection.
Featuresโ
Real-Time Updatesโ
- Document updates as you type
- See changes immediately
- No refresh needed
Proper Nestingโ
- Object fields show nested structure
- Array fields show proper array format
- Complex structures rendered correctly
Syntax Highlightingโ
- JSON syntax highlighting
- Easy to read format
- Color-coded elements
Collapsible Sectionsโ
- Expand/collapse nested objects
- Focus on relevant sections
- Handle large documents
Using Document Previewโ
Opening the Panelโ
- Open form in Form Builder
- Find Document Preview panel (usually on right side)
- Panel updates as you modify fields
Reading the Previewโ
{
"_id": "auto-generated",
"firstName": "John",
"lastName": "Doe",
"email": "john@example.com",
"address": {
"street": "123 Main St",
"city": "New York",
"zip": "10001"
},
"tags": ["customer", "premium"],
"createdAt": "2024-01-15T10:30:00Z"
}
Understanding the Structureโ
- Simple fields - Show as key-value pairs
- Nested objects - Indented under parent
- Arrays - Shown in bracket notation
- Empty fields - May be omitted or shown as null
Field Type Mappingsโ
See how form fields map to MongoDB types:
| Form Field | MongoDB Type | Example |
|---|---|---|
| Text | String | "Hello World" |
| Number | Number | 42 |
| Boolean | Boolean | true |
| Date | ISODate | "2024-01-15" |
| String | "user@example.com" | |
| Array | Array | ["a", "b", "c"] |
| Object | Object | {"key": "value"} |
| Lookup | ObjectId/String | "507f1f77bcf86cd799439011" |
Verifying Data Structureโ
Check Field Namesโ
- Ensure field paths are correct
- Verify camelCase or snake_case
- Match expected collection schema
Check Nestingโ
- Objects should nest correctly
- Arrays should contain proper items
- Repeater fields should create arrays
Check Typesโ
- Numbers should be numbers, not strings
- Dates should be ISO format
- Booleans should be true/false
Common Issuesโ
Field Not Appearingโ
- Check if field is marked as included
- Verify field has a value
- Check conditional visibility
Wrong Structureโ
- Review field path configuration
- Check parent-child relationships
- Verify array vs object settings
Type Mismatchโ
- Ensure field type is correct
- Check for string-to-number conversion
- Verify date format settings
tip
Use the Document Preview to verify that nested fields and arrays are structured correctly before inserting documents.
Best Practicesโ
- Check early - Verify structure before adding many fields
- Test all field types - Ensure each field maps correctly
- Verify nested data - Check complex object structures
- Match existing schema - Ensure compatibility with collection
- Review before publish - Final check before going live
Preview vs Actual Documentโ
The preview shows the document as it will be structured. The actual saved document may include:
- _id field - Auto-generated by MongoDB
- Timestamps - createdAt, updatedAt if configured
- Metadata - Form ID, submission source, etc.
- Computed fields - Calculated at submission time
Next Stepsโ
- Form Builder - Build your form
- Field Configuration - Configure fields
- Form Publishing - Publish your form