SELECT per table that maps its columns onto those objects’ fields.
How warehouse tables map to Conversion
Conversion stores records in objects that behave like tables. Contacts and companies are built in. Custom objects are tables you define. A sync reads rows from your warehouse and writes them as records of one object.
New to custom objects? Read Understanding Custom Objects first. It explains records, object IDs, primary fields, and which side of a relationship holds the link.
Set up a custom object warehouse sync
Before you begin
- A connected warehouse with a read-only user that can see the tables you plan to sync
- Admin access in Conversion to create objects, fields, and syncs
- Custom objects enabled for your workspace. If you don’t see the Custom objects section in Settings → Objects, contact Conversion.
1. Understand both data models and the goal
Before you write any SQL, get clear on two things: how data is modeled in Conversion, and what data you’re bringing over.- Conversion’s data model. Read Understanding Custom Objects. Conversion centers on contacts: audiences, emails, and workflows all act on contacts. A custom object is useful in Conversion mainly when its records link, directly or through other objects, to contacts or companies.
- Your data. List the tables you’re considering, their primary keys, and the foreign keys between them. Note which table holds your users and which column identifies them (a user ID, an email, or both).
Sketch the result as a small diagram of objects and their relationships, like the one above. Bring over only what the goals need. You can add fields and objects later.
2. Create the custom objects
- In Settings → Objects, create one custom object for each table you’re syncing. Don’t link it to a Salesforce object.
- On each object’s Fields tab, create a field for each column you want to sync. Unlike Salesforce syncs, warehouse syncs don’t create fields for you. Note each field’s Key: your query must use it as the column name.
- On each object’s Overview tab, choose the Primary field, usually the column that holds the record’s name.
object_id column.
3. Create the relationship fields
For each foreign key you want to keep, create a relationship field on the object whose table holds the foreign key (the child), pointing at the object the key refers to (the parent). In the example above,products has user_id and dashboard_id columns, so Products gets two relationship fields:
Conversion adds a matching list field to each parent (a contact’s Products, a dashboard’s Products). You never sync into those. They fill in from the child’s field.
4. Write one sync per object
Create a sync for each custom object, with Custom Objects as the destination type and the object selected. Each query must:- Select the table’s primary key
AS object_id. The sync editor flags a query without it (idalso works). - Name every other column with the Conversion field key, using
ASwhen the names differ. Columns that match no field are flagged in the editor. - Select each foreign key
ASthe key of its relationship field.
p.dashboard_id works as the link because it holds the same values that sync 1 selected as the dashboards’ object_id. A link to a custom object must always carry the related record’s object_id, never its name or another column.
The timestamp syntax differs by warehouse. See your warehouse’s guide: BigQuery, Snowflake, ClickHouse, or Databricks.
5. Check the results
- Run each sync and open its history on the Syncs tab to check rows processed and any errors.
- Open a few records in the custom object’s records list and confirm their fields and relationship chips.
- Open a linked contact and confirm the related records appear in the matching field on its Details tab.
- Share the result with your MOps leader and confirm it supports the audiences, workflows, and emails you agreed on.
How links resolve
- Order matters, but not strictly. If the related record doesn’t exist yet, the link stays pending and completes if that record arrives within a few days. Syncing parents first avoids the wait.
- Syncs never create the related record. A product linked to
ana@acme.comdoesn’t create that contact. Sync your contacts too, or make sure they already exist in Conversion. - Contacts link by
userIdor email. A relationship holds one record, so if several contacts share an email, the link reaches only one of them. PreferuserIdwhen your contacts sync uses it. - Companies link by Salesforce Account ID.
- One value per row. A relationship field holds one related record. If several rows share an
object_id, they overwrite each other’s values.
Common mistakes
Related
- Understanding Custom Objects: the mental model
- Custom Objects: full reference
- Data Warehouse Sync overview: column rules, schedules, and incremental syncing