RudderStack's Models feature lets you define and run custom SQL queries on your warehouse data and send the results to your specified destinations.

You can create a model in the RudderStack dashboard and use it while connecting a Reverse ETL source to a destination. For detailed steps on how to create a model, refer to the Models guide.

This guide is applicable for Reverse ETL sources configured using the Model option. If you have configured your Reverse ETL source using the Table option, refer to the Importing Data using Tables guide.

The settings to import and sync data from your model are listed below:

  1. Select the required model from the dropdown list.
models name enter
The dropdown will only display the list of models corresponding to the Reverse ETL source you have configured. For example, only the BigQuery models will be listed for a BigQuery warehouse source.
  1. Select the Sync mode that RudderStack will use to sync your data.

RudderStack supports two modes for syncing your data - Upsert and Mirror. For more information on these modes, refer to the Sync Modes guide.

  1. Select least one user identifier (user_id/anonymous_id) from the dropdown list.
models settings configure

You can also preview the data snippet which RudderStack will send to the destination. All the resulting columns from running the model's query are selected by default. However, you can choose to retain specific columns by searching and selecting them. You can then preview the resulting JSON on the right, as shown:

models data snippet
Alternatively, you can map the columns using the Visual Data Mapper feature. However, note that this feature is currently supported only for selective destinations.
The JSON payload carries the user_id and anonymous_id from the columns selected in the Choose user identifier section. Moreover, the traits are used from the columns selected in the Column section.

Add Constant

You can also use the Add Constant option to add a constant key-value pair which is always sent in the JSON payload, as shown:

add constant

The new constant will appear in the table and also in the JSON preview inside the traits, as shown:

add constant in json

You can also use the dot notation to define a constant, as shown:

dot notation constant

Once you have finalized the configuration, click on Save.

Updating an existing configuration

You can update the selection of columns from which RudderStack sends data to the specified destinations by following these steps:

  1. Click on the source and select the Schema tab.
  2. Then, click on the Update button, as shown:
update table selection
  1. Update your column selection.

When updating an existing configuration, you can only change the existing mappings. The Model, Sync mode, and the User identifier fields are not editable.

  1. Finally, click on the Save button.

After updating the configuration, the next sync will be a full sync.

Contact us

For more information on models, you can contact us or start a conversation in our Slack community.

Contents