Skip to main content
ImportResult stores the outcome of an import execution for a specific site and time period. Each result contains the processed data snapshot and the mappings that created form submissions.

Core Purpose

  • Result Tracking: Records what was imported per site/period
  • Data Snapshot: Preserves the processed output values
  • Mapping Record: Tracks which form elements received values
  • Auditability: Enables reviewing what an import actually changed

Entity Structure

Processed Data

The processedData field stores the output from the processor code: Simple output:
Periodic output (stored per result):
This field preserves the exact output types:
  • Numbers remain as numbers
  • Strings remain as strings
  • Booleans remain as booleans

Mapping Structure

The mapping field records how output values were inserted:
Each mapping entry shows:
  • outputKey: The processor output field
  • formElementId: The form element that received the value
  • valueInserted: The actual value that was stored

Period Handling

ImportResult supports different period granularities: Yearly (periodUnit: “YEARLY”, period: 1):
  • Single result per year
  • Used for annual totals or averages
Monthly (periodUnit: “MONTHLY”, period: 1-12):
  • Separate result for each month
  • Period 1 = January, Period 12 = December
Quarterly (periodUnit: “QUARTERLY”, period: 1-4):
  • Separate result for each quarter
  • Period 1 = Q1 (Jan-Mar), Period 4 = Q4 (Oct-Dec)

Multi-Site Results

For grouped imports, each site receives its own ImportResult:
The formSiteId links each result to the specific FormSite combination.

Rows Processed

The rowsProcessed field indicates how many source rows contributed to this result:
  • For ungrouped imports: equals the total row count
  • For grouped imports: equals rows matching this site’s group key

Access Control

ImportResult access is inherited from the parent Import:
  • Users can only see results from imports in their organization
  • RLS policies check the parent Import’s organizationId

Querying Results

Results for a specific import:
Results for a specific site:

Data Integrity

ImportResult records provide: Traceability: Know exactly what values came from imports vs manual entry Reproducibility: The processedData snapshot shows what the processor produced Debugging: Mapping records help diagnose incorrect values