Skip to main content

data-load-config-old

NOTE

This file described the old JSON version of the configuration. For the latest docs see Data Load Config.

Overview

The data load configuration format allows specifying which tables, referred to as objects, in the internal database to upload to Salesforce.

Fields

Fields are a list of columns from the internal database to upload to Salesforce. These should be mutually exclusive with the "lookups" list.

Lookups

In order to upload linked entities, such as an AccountContactRelation linked to an Account via the accountid column, you must use the "lookups" list to mark that column as a key. In this case Monarch will then automatically load AccountContactRelation first and then load Account. In the special case of 3 entities linked together in a 'cycle' you must use the "defer" value to choose which link to load last. It's important to note that "defer" keys cannot be nullable in Salesforce.

There are three types of deferred relationships parent, child, self. Parent and child relationships will defer fields that are foreign keys to other records and tables in staging. Self relationships will defer data fields in the record that need to be upserted after new records are already added to salesforce.

"objects": {
"contract": {
...
"lookups": [
{
"field": "ParentId",
"object": "contract",
"defer": true,
"relation": "parent"
},
{
"field": "Status",
"object": "contract",
"defer": true,
"relation": "self"
}
],

Relation

In each lookup the user can add an attribute called 'relation' which will determine which direction the foreign key relationship should be traversed in for Smart Copy and Smart Delete. If 'relation' is missing or 'child' it will be traversed from that entity to the linked entitity. If the 'relation' attribute is 'parent' it will be traversed from the linked entity to the entity with the 'lookup' object.

Configuration format

{
"objects": {
"account": {
"enabled": true, // setting this to false will temporarily remove this from the upload
"sf_api_name": "Salesforce Object Name",
"migration_id_field": "External ID field in Salesforce (will be automatically created)",
"lookups": [
{
"field": "Key to translate to Salesforce ID, don't repeat this in 'fields'",
"object": "Object to reference",
"relation": "parent" | "child" | undefined
"defer": true // if there's a 'cycle' then set this to true
},
...
],
"fields": [
"fields to upload",
...
]
}
}
}