Stores
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
This article explains how to prepare a “stores” file for import with Splio.
Prerequisites
- Basic knowledge of the CSV format and UTF-8 encoding.
- A UTF-8-enabled text editor.
- A spreadsheet software.
- The sub-sequence must be defined in the config file under the “contacts” scope.
Preparation of a store file
Edit the import file with your favorite UTF-8-capable text editor. If necessary, use a spreadsheet software you are comfortable with to control the number and position of columns.
Always remember to save using the UTF-8 encoding without BOM.
Header and Columns
The first line of the file, called the header, is used to determine the content of the following lines. Therefore, it should be constructed only from the names of columns.
Remember that Splio will skip the file if it encounters a column name it cannot recognize, or if the file does not contain the mandatory store_id column.
The following columns are available in the “stores” scope:
Column | Mandatory | Data Type / Maximum length | Description |
---|---|---|---|
store_id | Yes | Text (max. 50 characters) | The external identifier of the store; this column is mandatory and must be unique for each store. |
name | No | Text (max. 120 characters) | The name of the store. |
online | No | 0 or 1 | 1 if an online store, 0 if not. |
date_updated | No | YYYY-MM-DD HH:MM:SS | Date when the store was last updated. |
manager | No | Text (max. 120 characters) | The name of the store manager. |
store_type | No | Text (max. 120 characters) | The type of the store to display in Splio. |
date_added | No | YYYY-MM-DD HH:MM:SS | Date when the store was created. |
c0 | No | A custom column defined in your universe for “stores”. You can include up to 32 columns referred to as “c0” to “c31”. |
Note that all column names are always lowercase.
Example of a file
A short file containing three stores may look like this:
store_id;name;online;manager
MSEST;"Megastore East";"0";"Emma Smith"
EXBBY;"Express Store Brigby";"0";"Bob Brown"
OLDLV;"Online Delivery";"1";NULL
All rows have exactly four columns, store_id, name, online (only the last line is an online store), and manager. No custom columns are used.
Name your file
Save your file under a name composed of the universe name, scope (“stores”), sub-sequence, and current date. For example:
myuniverse_stores_apparel_20210315.csv
This filename belongs to the universe “myuniverse”, sub-sequence “apparel” defined for stores, and is dated March 15, 2021.
If you wish to know more, consult the “File Naming guidelines” section in the Overview article.
You can now upload the file to SFTP/FTPS.
Dates
All dates used in import files need to be formatted in the following way: 4 digits for year, 2 for month, and 2 for day, followed by hours, minutes, and seconds, 2 digits each. A correct date for March 15th, 2021, 1:37 PM takes the following form:
2021-03-15 13:37:00
The day and hour are separated by a blank space. You can omit the time part and only use the date. If you do, Splio will assume the earliest possible hour for the day (midnight). Therefore,2018-09-09
equals 2018-09-09 00:00:00
.
- Using dates without time should never be an option for dates and times: 00:00:00 is midnight and Splio will try to process the date as such. This may result in errors and some triggers associated with dates will fail. An additional benefit of using complete dates is that you will be able to search and filter by date with much greater accuracy.
- When importing dates with time, make sure to always use the same timezone (it is GMT+1 for clients outside of China, and GMT+8 for Chinese clients).
Explanation: NULL and erasing values
NULL is a special value that tells the database that the field holding it is empty.
Your Splio universe can be configured to interpret NULL values as instructions to empty fields. You can use this to erase values stored in the database. To do so, make sure that the imported value is exactly NULL. You need to avoid leading or trailing spaces: " NULL" or “NULL” will be recognized as string values.
If this option is not set, Splio will retain the values for the fields where the imported value is “NULL”.
Difference between NULL and empty string
"" is an empty string. In most cases, both NULL and "" will be imported as an empty value.
Most importantly, the empty string "" is never considered a NULL value, so it will not cause an existing value to be erased.
Updated 4 months ago