Danvas
Danvas
DashboardSupportWelcome

👤 USER DOCS

User Guides

Getting Started

Getting StartedDashboard & OnboardingApp Settings

Tutorials

Tutorial: Setting Up Shift Tasks & ClosersTutorial: Managing Incidents in the InboxTutorial: Tracking Compliance & Sync StatusTutorial: Operational Workflows with the AI AssistantTutorial: Building & Deploying Custom Checklists

Daily Operations (Staff)

Shift Workspace & TasksService Day SetupDaily Line-UpStaff Service Day ReportsForms

Communication & Chat

Messages & AnnouncementsUnified Operations InboxAI Assistant

Manager & Admin Guides

Daily Line-Up SetupStaff SchedulingManaging LocationsNPS and Guest FeedbackCouponsContacts and Guest HistoryManager CloseoutsDaily Line-Up & ComplianceAnalyticsIncident ReportingWhistleblower Concerns & FeedbackAdmin Tools

⚙️ DEVELOPER DOCS

Getting Started

Getting StartedDevelopmentDeployment Guide

Architecture

Architecture OverviewExplanation: AI Integration & Tenant SecurityExplanation: Dynamic Forms Engine DesignExplanation: Compliance Ledger DesignExplanation: Live Sync & Data FreshnessData FlowArchitecture Decision Records

Core Domain

Core DomainDatabase ReferenceLocations DomainAuth & RBACScheduling DomainReports DomainIncidents DomainUnified Operations InboxLive Sync Data FreshnessToast Sync PipelineNotifications DomainCoupons and Guest NPSAudit Log & Compliance ArchitectureDesign Audit FindingsAI Chat IntegrationAnalytics & Tips Integration

Frontend

Frontend ArchitectureFormsLoading SkeletonsComponentsPWA & Offline ShellScreenshots

API Reference

API Reference

Endpoints

POS Sales APIOptimization Data APISchedule Shifts APIEmployee Export APIReports APIIncidents APIAI Chat APIPush Notifications APIWebhooks APICron API

Contributing

ContributingCode Examples

Security

Security & Compliance

Release Notes

What's New

Forms

Build and submit dynamic forms per location

Danvas forms provide a flexible system for building custom data collection workflows per location. Forms are defined with a JSON schema and rendered dynamically at runtime.

Submission behavior: The reusable pending, validation, success, reset, conflict, autosave, and rate-limit rules live in the canonical Form Submission UX Standard. This page is the published feature reference for dynamic forms.

Overview

Admins build forms using a visual form builder. Each form has a name, description, and array of field definitions. Staff then fill out forms on any device — submissions trigger Slack notifications and update compliance tracking.

Field Types

Danvas supports 9 field types, including the persisted-schema and renderer-supported rating_scale field:

TypeDescriptionValidation
textSingle-line text inputMax 500 chars
textareaMulti-line text inputMax 5000 chars
numberNumeric inputRange validation available
emailEmail addressEmail format check
selectSingle dropdownOptions defined in form
multiselectMultiple choice checkboxesAt least 1 required
dateDate pickerISO date format
checkboxBoolean toggleReturns true/false
rating_scaleInteger rating controlConfigurable range, defaults to 1–5

Form Schema

Forms are stored as JSONB with this structure:

interface FormField {
  id: string;
  type: FieldType;
  label: string;
  placeholder?: string;
  required: boolean;
  options?: FormFieldOption[];  // For select/multiselect
  validation?: {
    min?: number;
    max?: number;
    pattern?: string;
  }; // For number/rating_scale
}

interface Form {
  id: string;
  name: string;
  description: string;
  fields: FormField[];
  isActive: boolean;
  createdAt: Date;
  updatedAt: Date;
}

Dynamic Rendering

Forms are rendered dynamically using:

  • React Hook Form — Form state management
  • Zod — Schema validation generated from field definitions
  • Server Actions — Form submission handling

The renderer maps each field type to its appropriate input component, applies validation rules, and handles submission to the server.

Draft Autosave

Forms support automatic draft saving to prevent data loss:

  • Drafts are saved to localStorage as users type (throttled to once per 30 seconds)
  • If the page is accidentally closed, the draft is restored on next visit
  • Drafts are keyed by form ID + user ID for multi-form support
  • Clearing a submitted form removes the draft

Forms do not support photo or file uploads. Use Shift Reports or Incidents for attachments.

CSV Export

Form submissions can be exported as CSV from the admin submissions view, making it easy to analyze collected data in spreadsheet tools.

Submission Flow

  1. User fills out form fields in the browser
  2. Client-side validation via Zod schema (generated from form JSON)
  3. Server action submitForm() receives validated data
  4. Data stored in form_submissions table with timestamp
  5. Slack notification sent to configured channels (if locationId provided)
  6. Compliance row updated if form is a shift/manager report

Slack Notifications

When a form is submitted, a Slack message is sent using Block Kit formatting:

// apps/slack-bot/lib/templates/dynamic-form.ts
function buildDynamicFormBlocks(form: Form, submission: FormSubmission) {
  return [
    { type: "header", text: { type: "plain_text", text: form.name } },
    { type: "section", fields: [...] },
    { type: "context", elements: [...] }
  ];
}

Configure Slack routing in Admin → Notifications → Slack through the protected environment workflow. See the Slack notifications how-to for the setup checklist; the Slack integration reference owns delivery and variable details.

Seeded Form Examples

The database seed includes these demo forms:

FormPurposeFields
Opening ChecklistPre-shift verificationtextarea, select (ratings), checkbox, number (temp)
Incident ReportSafety/event reportingtext, date, select (severity), textarea
Shift LogEnd-of-shift notesVarious text and number fields

Configuration

Environment Variables

Environment-variable ownership and Slack secret handling live in the Slack integration reference and the protected environment workflow. Form-type routing is configured through the slack_configs admin surface.

Form Builder Permissions

Only admins can create/edit forms. Form submission is available to all authenticated users.

Related Files

FilePurpose
apps/app/src/app/(authenticated)/admin/forms/form-builder.tsxAdmin form builder UI
apps/app/src/app/(authenticated)/admin/forms/actions.tsForm CRUD server actions
apps/app/src/app/(authenticated)/forms/[formId]/form-submission-client.tsxDynamic form renderer
apps/app/src/app/(authenticated)/forms/form-actions.tsSubmit form server action
packages/database/src/schema/forms.tsforms and form_submissions tables
apps/slack-bot/lib/templates/dynamic-form.tsSlack message builder

Frontend Architecture

Technical design of the Next.js App Router and design system

Loading Skeletons

Architecture pattern for loading states and skeleton components

On this page

OverviewField TypesForm SchemaDynamic RenderingDraft AutosaveCSV ExportSubmission FlowSlack NotificationsSeeded Form ExamplesConfigurationEnvironment VariablesForm Builder PermissionsRelated Files