Datasets
Datasets provide lookup data from the KASKO Data Service. They enable autocomplete inputs, field mapping, and dynamic data integration.
How Datasets Work
A field is configured with the
in_dataset:DATASET_IDvalidation ruleThe user selects/enters a value using a dataset component
The selected item's ID (prefixed with
dai_) is stored in the fieldThe framework fetches the full dataset item
The dataset item is exposed under the
datasetnamespace
Dataset Item Structure
When a dataset item is loaded, it looks like this:
{
id: string; // Dataset item ID (e.g., "dai_abc123...")
dataset_id: string; // Dataset ID (e.g., "dat_xyz789...")
[key: string]: any; // Arbitrary data fields from the dataset
}Dataset Components
form-data-input
Typeahead/autocomplete input:
field_name
Field that stores the dataset item ID
data_field_name
Dataset field used for search/display
field_map
Maps form fields to dataset fields (auto-fill on selection)
filter_by
Filter dataset results by criteria
sort
Sort results: "asc" or "desc"
wait_ms
Debounce time in milliseconds
min_length
Minimum characters before search triggers
clear_fields_on_change
Fields to clear when selection changes
form-data-lookup
Dropdown lookup:
dataset-map
Invisible mapper that fills additional fields when a dataset item loads:
Validation
Fields using datasets must include the in_dataset rule:
First argument is the dataset ID (starts with
dat_)Backend validates the value exists in the dataset
Frontend ignores validation for
in_dataset, but dataset lookup still requires it
Accessing Datasets in JsonLogic
Dataset items are available under the dataset namespace:
Access fields:
Accessing Datasets in Content
Use dataset tokens in translations:
Repeaters
Datasets work with repeater fields:
Each repeater item has its own dataset entry:
dataset.data.agents.0.locationdataset.data.agents.1.location
Filtering Results
Basic filters:
Advanced filters:
Automatic Cleanup
When a dataset field is cleared or changed:
The old dataset item is removed from state
Prevents stale data from accumulating
Tips
Use
field_mapordataset-mapto auto-fill related fieldsKeep
field_namealigned with the form field path (e.g.,data.company)Use
clear_fields_on_changeto reset dependent fields when selection changes
Last updated