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
TheprocessedData field stores the output from the processor code:
Simple output:
- Numbers remain as numbers
- Strings remain as strings
- Booleans remain as booleans
Mapping Structure
Themapping field records how output values were inserted:
outputKey: The processor output fieldformElementId: The form element that received the valuevalueInserted: 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
- Separate result for each month
- Period 1 = January, Period 12 = December
- 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:formSiteId links each result to the specific FormSite combination.
Rows Processed
TherowsProcessed 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: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 valuesRelated Entities
- Import: The parent execution record
- ImportDefinition: Defines the transformation rules
- FormSite: The target form-site combination
- FormElementSubmission: The actual stored values

