Skip to main content

Target Data Models (TDMs)

Target data models define the structure of the output data in all nuvo pipelines. They ensure that the mapped and transformed data is organized according to the desired format and schema required by the destination system.

You can create, read (all/by id), update and delete target data models using:

  • the target data model API
  • the target data model embeddables (coming soon)
  • the nuvo user platform (coming soon)

Within a target data model, you can define the name of each column at both a UI-based level (label) and a technical level (key). Additionally, you can apply required, unique, and regex validations, as well as specify the column type (e.g., float, int, date, currency, etc.)

This ensures that the pipeline’s output not only has the correct structure but also that the values are in the correct format.

For example, if you want the output to contain objects with the keys customer_name, domain_name, region, deal_size, address, and done, you would define the target data model as follows:

Example

columns: [ { label: "Customer Name", key: "customer_name", type: "string" }, { label: "Domain Name", key: "domain_name", type: "url" }, { label: "Region", key: "region", type: "string" }, { label: "Deal Size", key: "deal_size", type: "float" }, { label: "Address", key: "address", type: "string" }, { label: "Done", key: "done", type: true } ];

How to create a TDM with the nuvo pipeline API?

The nuvo pipeline API provides a convenient way to create a target data model (TDM) for importing data via a pipeline.

Learn how to authenticate yourself with our authentication API and then use the target data model API to create your TDMs.

After setting up the general structure of your target data model, we recommend you to add more validation rules so that you can ensure that the user-submitted data is not only in the correct schema but also the values are in the preferred format.

The column class includes several properties. In the following, all properties of the column class are displayed, including its default value, data type and description.

label (required)

Typestring
Descriptionlabel is one of two required properties of a column object. The value is displayed within the UI to the user, who goes through the importing workflow. This value and the key value is used for the column matching.

key (required)

Typestring
DescriptionThe value of key defines how your application calls a column. This value is not displayed to your users, but like the label, it is used for column matching.

alternativeMatches

Type[ string, ... ]
Descriptionnuvo utilizes machine learning with a logic-based component to provide an intelligent and advanced mapping functionality. To be able to force a more precise matching, we offer an additional matching layer with the alternativeMatches property. This should help match the target and imported columns more accurately because every item of the alternativeMatches array is considered for calculating the similarity between imported and target model columns. We recommend adding abbreviations and synonyms here.

validations

Type[ ValidationObject, ... ]
DescriptionWith the validations option, you can define the preferred format for your columns and their values. You can also add customized error messages to guide your users on how to correct their input. Each object in the validations array can contain up to five keys:
  • validate
  • errorMessage
  • regex
  • columns
  • columnValues

validate

Typestring
DescriptionWith this option, you can use one of our pre-built validation rules such as required, unique, regex and many more. This property offers you the possibility to ensure the highest-possible data quality.

errorMessage

Typestring
DescriptionWith this option, you can add an fully customized error message to one of the validation rules above. This notification text overwrittes the pre-built error message.

regex

Typestring
DescriptionThis option contains the regular expression which should be applied to all cells of the column using this validation rule. The value of this property is only required, if validate equals regex within the ValidationObject. The regular expression needs to be JSON-escaped. For more information, visit our regex documentation.

columns

Type[string, ...]
required for all column-cross validation rules
DescriptionThis array contains all columns that need to be checked against the column using this validation rule. It is only required when you use validate with required_with, required_without, required_with_all and required_without_all. In the following example, it is displayed how to use required with. The same syntax can also be used with required_without, required_with_all and required_without_all.

columnsValues

Type{columnName: [string, ...], ...}
required for all value-based validation rules
DescriptionThis object has a key related to the column name of the column you want to select and the value you want to validate against as the value. It is only required when you use validate with required_with_values, required_without_values, required_with_all_values or required_without_all_values. In the following example, it is displayed how to use required_with_values. This same syntax can also be used with required_without_values, required_with_all_values and required_without_all_values.

Validation rules

Default validation rules

  1. validate: "unique" - This function makes sure that no duplicates can be entered within a column. Every cell that contains a duplicated value is highlighted as an error. Please note that the first appearance of the repeated value is not marked as an error.

Example

columns: [ { ... validations: [{ validate: "unique" }], ... } ]
  1. validate: "required" - This option ensures that the column is filled and throws an error for the user to notify.

Example

columns: [ { ... validations: [{ validate: "required" }], ... } ]
  1. validate: "regex" - This option enables you to add your preferred regular expression that you want to validate against. Please note that this regular expression must be JSON escaped and a string. For further information, how to use regular expressions within the nuvo importer checkout our regex documentation.

Example

columns: [ { ... validations: [ { validate: "regex", regex: "^https\:\/\/([A-Za-z0-9]+)\.([A-Za-z]{1,3})$" }, ] ... } ]

Column-cross validation rules

  1. validate: "required_with" - In case any cells within the same entry/row of the columns defined in the columns array are filled, the column cells should not be empty.
  2. validate: "required_without" - In case any cells within the same entry/row of the columns defined in the columns array are left empty the column cells should contain a value.
  3. validate: "required_with_all" - In case all cells within the same row of the columns defined in the columns array are filled the column cells should contain a value.
  4. validate: "required_without_all" - In case all cells within the same row of the columns defined in the columns array are empty the column cells should contain a value.

Example

columns: [ { label: "Region", key: "region", validations: [ { validate: "required_with", columns: ["address"], }, ], }, { label: "Address", key: "address", }, ];

Value-based validation rules

  1. validate: "required_with_values" - In case at least one cell within the same row of the columns defined in the columns array is filled and has a particular value - determined within the columnValues property - the column cells should contain a value and not be empty.
  2. validate: "required_without_values" - In case at least one cells within the same row of the columns defined in the columns array are present and do not have the specific value determined within the `columnValues property the column cells should contain a value.
  3. validate: "required_with_all_values" - In case all cells within the same row of the columns defined in the columns array are filled and have the specific value determined within the columnValues property the column cells should contain a value and not be empty only.
  4. validate: "required_without_all_values" - In case all cells within the same row of the columns defined in the columns array are filled and do not have a particular value determined within the columnValues property the column cells should contain a value.

Example

columns: [ { label: "Deal Stage", key: "deal_stage", }, { label: "Deal Size", key: "deal_size", validations: [ { validate: "required_with_values", columnValues: { deal_stage: ["Closed"], }, }, ], }, ];

columnType

Type``"int", "float", "string"`, and more
Optional
DescriptionThis option allows you to define the type of the column. You can either choose if the column should contain values which are an int, a float, a string or many more.
info

You can find a full list of column types with pre-build data validation rules in our column types documentation.


outputFormat

Typestring
Optional & usable ifcolumnType: "date"
DescriptionWith this key, you can support all your preferred date and timestamp formats such as MM/DD/YYYY, DD.MM.YYYY, YYYY-MM-DD, etc.

Use the following date variables to create your desired format:

TypeSyntaxOutput
MonthM1, 2, 3, ..., 12
MonthMo1st, 2nd, 3rd, ..., 12th
MonthMM01, 02, 03, ..., 12
MonthMMMJan, Feb, Mar, ..., Dec
MonthMMMMJanuary, February, March, ..., December
DayD1, 2, 3, ..., 31
DayDo1st, 2nd, 3rd, ..., 31st
DayDD01, 02, 03, ..., 31
DayDDD1, 2, 3, ..., 365
DayDDDD001, 002, ..., 365
YearY1970, 1971, 1972, ..., +10000
YearYY70, 71, 72, ..., 27
YearYYYY1970, 1971, 1972, ...., 2027
YearYYYYYY-001970, -001971, -001972, ..., +001907
HourH0, 1, 2, ..., 23
HourHH00, 01, 02, ..., 23
Hourh1, 2, 3, ..., 12
Hourhh01, 02, 03, ..., 12
Hourk1, 2, 3, ..., 24
Hourkk01, 02, 03, ..., 24
Minutem0, 1, 2, ..., 59
Minutemm00, 01, 02, ..., 59
Seconds0, 1, 2, ..., 59
Secondss00, 01, 02, ..., 59
Time zoneZ-07:00, -06:00, -05:00, ..., +07:00
Time zoneZZ-0700, -0600, -0500, ..., +0700
Unix timestampX855599530642
AM/PMAAM, PM
AM/PMaam, pm
QuarterQ1, 2, 3, 4
QuarterQo1st, 2nd, 3rd, 4th

info

This table is based on the original table from the open source library Moment.js. You can find the original table and its documentation here. Please note that the table has been adjusted. You can use all variables given in the original table apart from the Day of Week ones.


In the following, you can find an example of how to implement a date column with the format MM/DD/YYYY and a timestamp column with the format YYYY-MM-DDTHH:mm:ss:

Example

columns: [ { label: "Date", key: "date", columnType: "date", outputFormat: "MM/DD/YYYY", }, { label: "Timestamp", key: "timestamp", columnType: "date", outputFormat: "YYYY-MM-DDTHH:mm:ss", }, ];

numberFormat

Type"eu" | "us"
Default"eu"
DescriptionThis property is applicable for int, float, currency_eur, currency_usd, and percentage column types. It affects how the numbers will be displayed at the review step. If the value is "eu", then a comma will used as a decimal delimiter, and dots will be used as thousands delimiters. If the value is "us", then a dot will used as a decimal delimiter, and commas will be used as thousands delimiters.