Search documentation...

K

Models overview

To learn about defining data models for Audiences, refer to the Customer Studio documentation.

Hightouch models define and organize the data you want to query from a source.

Model diagram

To create a new model, navigate to the Models page and click Add model. Next, select one of you the sources you've setup. Then choose a modeling method:

  • SQL editor
  • Table selector
  • dbt model selector
  • Looker
  • Sigma

Modeling methods in the Hightouch app

Supported modeling methods depend on the source. Refer to source documentation to learn about supported modeling methods.

Refer to the SQL editor and table selector docs for details on how to use those modeling methods.

Refer to the Extensions documentation to learn more about how to connect Hightouch to these platforms and build Hightouch models using existing dbt models, Looker Looks, or Sigma workbooks.

Unique primary key requirement

Regardless of how you build your models, you must configure them with a unique primary key. To configure a model's primary key, select the column with unique values from your dataset when prompted during model setup.

Selecting a primary key in the Hightouch app

To ensure your destinations receive all desired data, it's imperative to select a truly unique primary key. Hightouch uses this unique identifier to keep track of records. Using a unique key lets Hightouch sync only new and updated data to your destinations. See the change data capture docs to learn how Hightouch accomplishes this.

If your dataset doesn't inherently include any truly unique columns, you can use the SQL editor to either filter out duplicate rows or create a composite column to use for your primary key. If you're not using the SQL modeling method or if SQL isn't supported by your source, you need to make changes to your data upstream to ensure it includes a unique column.

If you select a different column to use for a model's primary key, you need to trigger a full resync for all syncs that use that model. Otherwise, change data capture won't work correctly and the data in your destination may be incorrect.


You don't need to trigger a full resync if you change the primary key column's data type.

Data types and casting

When you define a model, Hightouch doesn't change the data types found in your source unless otherwise specified. To safeguard your syncs from failing, the data types your model returns must align with your destination's data type expectations. If your source data types don't match your destination's expectations, you can use data casting while setting up your models.

Preview model results

When first defining a model, it's highly recommened to Preview results before you continue with setup. Previewing lets you validate the data your model returns before syncing it to downstream destinations.

Previewing a new model's query results

Previewing a model's query results can also be helpful when troubleshooting issues. To preview an existing model's results, open the model's overview page and click Edit.

Previewing an existing model's query results

You can then select to Preview results.

Previewing an existing model's query results

If you want to display all model rows, click the gear symbol, then toggle off Limit preview to 100 rows. You can also turn off Show row count to improve loading performance for larger data models.

Clone models

After creating a model, you can clone it by opening the horizontal three-dot menu on its overview page and clicking Clone.

Cloning a model in the Hightouch app

This opens a new page where you can:

  • edit and preview the cloned model's query
  • select which syncs to clone, if the model you're cloning has syncs associated with it
  • give it a custom name and description
  • confirm which model column to use as the primary key

Once you finish creating the cloned model, you can further edit it and configure additional syncs on it, like any other model.

Ready to get started?

Jump right in or a book a demo. Your first destination is always free.

Book a demoSign upBook a demo

Need help?

Our team is relentlessly focused on your success. Don't hesitate to reach out!

Feature requests?

We'd love to hear your suggestions for integrations and other features.

Last updated: May 25, 2023

On this page

Unique primary key requirementData types and castingPreview model resultsClone models

Was this page helpful?