Per-Customer Overrides
Why use Customization and Template Overrides
Customizations and Templates determine the behavior of OneSchema importers. Using overrides can allow specific behavior for individual importing sessions.
Template Overrides
When to override
- Adjusting template column behavior on a per-customer basis (eg. picklist options).
If you are using our SDK to initialize your importer, pass in templateOverrides as part of the OneSchemaLaunchParams
.
If you are using the API, pass in template_overrides
to the create embedded session endpoint.
The format for templateOverrides
is OneSchemaTemplateOverrides
documented below.
OneSchemaTemplateOverrides
Key | Type | Description |
---|---|---|
columns | OneSchemaTemplateColumn[] | Array of column level overrides |
OneSchemaTemplateColumn
Key | Type | Description |
---|---|---|
key | string | Unique key identifier for a given template column |
label | string | Display label of the template column for end users |
data_type | string | Data type for the template column (eg. "PICKLIST" or "NUMBER") |
validation_options | Object | Additional validation properties on top of specific data types (eg. values for picklists or only_int for numbers) |
description | string | Description displayed to end user |
is_custom | boolean | Whether the template column should act as a Custom Column |
is_required | boolean | Cells in this column cannot have blank values. |
is_unique | boolean | All values in the column must be unique |
letter_case | string | Casing validation for the column (eg. "LETTER_CASE_UPPER", "LETTER_CASE_LOWER", or "LETTER_CASE_TITLE") |
min_char_limit | integer | Min number of characters |
max_char_limit | integer | Max number of characters |
delimiter | string | Delimiter character to be used for separating multi-value fields. |
must_exist | boolean | Column must be mapped |
default_value | string | Automatically replace empty cells with provided default value |
mapping_hints | string[] | Array of sheet column names to automatically map this column to |
Sample Usage
Below is an example use case for a number of overrides to a sample template with key crm_test
. We are:
- Replacing the valid picklist values on column
segment
to["A", "B"]
- Updating column
phone_number
to be both required and unique - Updating the description and label of column
metadata
const importer = oneSchemaImporter({
clientId: "CLIENT_ID",
userJwt: "USER_JWT",
templateKey: "crm_test",
templateOverrides: {
columns: [
{
key: "segment",
validation_options: {
values: ["A", "B"],
},
},
{
key: "phone_number",
is_required: true,
is_unique: true,
},
{
key: "metadata",
label: "Customer Info",
description: "Provide any additional metadata about the customer as freeform text."
}
],
},
})
Customization Overrides
When to override
- Updating branding options for specific customers.
If you are using our SDK to initialize your importer, pass in customizationOverrides as part of the OneSchemaLaunchParams.
If you are using the API, pass in customization_overrides
to the Create an Embedded Session endpoint.
A comprehensive list of all customization options can be found on the Customizations page.
Sample Usage
Below is an example of how to pass in customizationOverrides
to the base JavaScript SDK. These options will:
- Update the primaryColor to be "#FF0000"
- Show the informational sidebar on upload pane
- Change the import experience to be "ignoreErrors"
const importer = oneSchemaImporter({
clientId: "CLIENT_NAME",
userJwt: "USER_JWT",
templateKey: "crm_test",
customizationOverrides: {
primaryColor: "#FF0000",
uploaderShowSidebar: true,
importErrorUX: "ignoreErrors"
},
})
Updated 4 months ago