Tutorial
Other languages available for this guide
🇫🇷 La version française de ce guide
🇪🇸 La versión española de esta guía
🇮🇹 La versione italiana di questa guida
Prerequisites
To take advantage of this tutorial, you will need the following:
- Basic knowledge of the JSON format.
- Knowledge of the configuration file options.
- Basic knowledge of databases and related terms: record, update, etc.
Use Case 1
This case describes the config file for the “myuniverse_crm” universe.
Josh Beets is a CRM Director at his company, which makes him responsible for creating and maintaining the config file for imports.
Context: contacts
Josh defines two sub-sequences for this context, PRCL and MGTSB:
- The PRCL sub-sequence allows for both creating and updating existing contacts (“create contacts”: “1”, “update contacts”: “1”). Also, the list 0 is reset for this import (“init lists”: [0]) – we call it “full mode” sync. This way, if all imported contacts are subscribed to this list, it will always allow you to target the most recent import.
- The purpose of the MGTSB sub-sequence is to place contacts in list 1. The list is cleared before each import (“init lists”: [1]), and the creation of new contacts is prevented (“create contacts”: “0”).
Since all contacts are supposed to come from France, Josh wants to apply the French country code to all phone numbers which do not contain it (“default cellphone prefix”: “33”).
Context: products
Here, sub-sequences are also used for different purposes.
- The ERP sub-sequence is used to update existing products in the database it will be used whenever a product description or price needs to be changed. New products may not be added with this import (“create products”: “0”, “update products”: “1”).
- By contrast, both the MGTEN and MGTFR are intended to add new products. When an option is not present, Splio assumes its default value (“create products”: “1”, “update products”: “1”).
Finishing touches
The remaining contexts, orders and ordersitems, do not contain any restrictions.
Before submitting the file, Josh needs to make sure that he has supplied the email addresses to receive the import report (“report recipients”: [“[email protected]”]) and alerts (“alert recipients”: [“[email protected]”]).
He also sets the overwrite option to zero (“overwrite with empty values”: “0”). This is important whenever you import contacts or other data which already exists in the database. With this option set to 0, Josh is sure that the value in the base will be preserved if the field in the file is empty.
Having double checked everything, Josh submits the file to Splio.
The JSON file
You can see the whole JSON file submitted to Splio below.
"myuniverse_crm":{
"contacts":{
"PRCL":{
"report recipients": ["[email protected]"],
"alert recipients": ["[email protected]"],
"overwrite with empty values": "0",
"default cellphone prefix": "33",
"create contacts": "1",
"update contacts": "1",
"init lists": [0]
},
"MGTSB":{
"report recipients": ["[email protected]"],
"alert recipients": ["[email protected]"],
"overwrite with empty values": "0",
"default cellphone prefix": "33",
"create contacts": "0",
"update contacts": "1",
"init lists": [1]
}
},
"orders":{
"ERP":{
"report recipients": ["[email protected]"],
"alert recipients": ["[email protected]"],
"overwrite with empty values": "0"
}
},
"ordersitems":{
"ERP":{
"report recipients": ["[email protected]"],
"alert recipients": ["[email protected]"],
"overwrite with empty values": "0"
}
},
"products":{
"ERP":{
"report recipients": ["[email protected]"],
"alert recipients": ["[email protected]"],
"overwrite with empty values": "0",
"create products": "0",
"update products": "1"
},
"MGTEN":{
"report recipients": ["[email protected]"],
"alert recipients": ["[email protected]"],
"overwrite with empty values": "0"
},
"MGTFR":{
"report recipients": ["[email protected]"],
"alert recipients": ["[email protected]"],
"overwrite with empty values": "0"
}
}
}
}
Use Case 2
Case 2 presents a config file with a slightly different policy than Case 1. It gives priority to the imported file (“overwrite with empty values”: “1”), meaning that if you update a record, all data will be overwritten, even if the field in the imported file is empty.
Meet Bill Hook, a Deputy Marketing Director, who is tasked with preparing the config file. He is going to use the same email addresses for reports and alerts in all contexts and sub-sequences.
Context: contacts
In this context, Bill is going to define two sub-sequences:
- The “full” sub-sequence is meant to re-import the whole collection of contacts from an external source. For this reason, he allows the accounts to be created (“create contacts”: “1”) and updated (“update contacts”: “1”). The policy to allow values to be replaced with NULLs (“overwrite with empty values”: “1”) will be useful here: if some information was removed in the source, it will also be removed from the base of contacts in Splio. Bill also makes sure to re-initialize list 0 (“init lists”: [0]), which will then be filled with the imported data.
- The “incremental” sub-sequence is defined the same as “full” with just one significant difference: the list 0 is not cleared. This means that this import will be able to add and remove members of the list using values in the “subscription” field or leave it unchanged.
Both sub-sequences also assume that the imported phone numbers are from France (“default cellphone prefix”: “33”), instructing Splio to use the French prefix for all numbers that do not have it.
Context: orders, ordersitems, and products
The remaining contexts do not use any special restrictions. Bill leaves the options to allow creating and updating product records as they were in the previous version of the file (“create products”: “1”, “update products”: “1”). Although these are the default values and could be removed, he leaves them as a reminder that this behavior during import is important.
The JSON file
You can see the complete JSON file below.
{
"mybrand2":{
"contacts":{
"full":{
"report recipients": ["[email protected] , [email protected]"],
"alert recipients": ["[email protected] , [email protected]"],
"overwrite with empty values": "1",
"default cellphone prefix": "33",
"create contacts": "1",
"update contacts": "1",
"init lists": [0]
},
"incremental":{
"report recipients": ["[email protected] , [email protected]"],
"alert recipients": ["[email protected] , [email protected]"],
"overwrite with empty values": "1",
"default cellphone prefix": "33",
"create contacts": "1",
"update contacts": "1"
}
},
"orders":{
"default":{
"report recipients": ["[email protected] , [email protected]"],
"alert recipients": ["[email protected] , [email protected]"],
"overwrite with empty values": "1"
}
},
"ordersitems":{
"default":{
"report recipients": ["[email protected] , [email protected]"],
"alert recipients": ["[email protected] , [email protected]"],
"overwrite with empty values": "1"
}
},
"products":{
"default":{
"report recipients": ["[email protected] , [email protected]"],
"alert recipients": ["[email protected] , [email protected]"],
"overwrite with empty values": "1",
"create products": "1",
"update products": "1"
}
}
}
}
Updated 11 days ago