Parameters
The following parameters are in the computed field’s global Method parameter:Examples
The following example shows using a mapper to standardize a time duration. ConfigJSON
Output
JSON
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
| key | value | description |
|---|---|---|
| id (required) | mapper | |
| source_id (required) | a field id in the current configuration | The id of the field to map |
| mappings (required) | object | An object with mappings from strings or numbers to output strings represented as key/value pairs, for example, { “03/04”: “March 4th” }. Key value pairs are case sensitive. |
| default | string or null | If a source field exists, but the mapping doesn’t exist, Sensible returns the value specified by this parameter. The specified value can be null or it can be a string, for example, “mapping doesn’t exist”.If the source field doesn’t exist or is null, Sensible ignores this parameter and always returns null. |
{
"fields": [
{
"id": "_premium_period_raw",
"anchor": "duration",
"method": {
"id": "row"
}
}
],
"computed_fields": [
{
"id": "premium_period_months",
"type": "number",
"method": {
"id": "mapper",
"source_id": "_premium_period_raw",
"mappings": {
"ANNUAL": "12",
"BIANNUAL": "6",
"MONTHLY": "1",
"Six months": "6",
"six months": "6",
"Twelve months": "12",
"twelve months": "12",
"default": "mapping doesn't exist"
}
}
}
]
}
| Example document | Download link |
|---|
{
"_premium_period_raw": {
"type": "string",
"value": "Six months"
},
"premium_period_months": {
"source": "6",
"value": 6,
"type": "number"
}
}
