CSV Import file
As a Purple User you can upload a CSV file containing metadata and file references for the issues you wish to import. The Purple Importer constantly checks (every few minutes) to see if a new CSV file has been uploaded or if existing ones have been updated. A CSV file can be placed anywhere in the directory and the Importer will find it.
The CSV (Comma-Separated Values) file is a simple and widely used file format for storing tabular data, such as spreadsheet or database information.
CSV REQUIREMENTS FOR PURPLE IN A NUTSHELL
- Use only semicolon (;) as a delimiter. Do not use any other delimiter
- Each row of the CSV file must specify exactly one issue
- Use only UTF-8 as text encoding when saving the CSV files
- Do not use additional delimiters such as comma, tab etc.
- The CSV file has to end with ".csv"
Here's a more detailed breakdown of the general setup:
Purple CSV files use exclusively semicolon (;) as a delimiter to separate the values in each row.
It is very important not to use any other available delimiter as this would result in the file getting broken
Like a table, a CSV file consists of rows and columns. Each row represents a separate entry or record, and each column represents a specific attribute or piece of information related to that entry.
Typically, the first row of a CSV file contains headers, which are names or labels for each column. These headers describe the data in each column and help users understand what each column represents.
The sample graphic below shows the first row containing the column headers (dark blue). Following the header row which contains the column headers, each subsequent row contains the actual data values. These values are separated by the delimiter and correspond to the columns defined by the headers.
Mandatory header types
Column Header | Description |
---|---|
folder | Relative path to your input file |
publication | Publication name in Purple Manager |
issue name | The issue name displayed in app/web experience |
publication date | Date/time that will be set as publication date for the issue. |
Recommended header types
Column Header | Description |
---|---|
access | Set issue access in Purple Manager (see below). |
android product | The Product-ID for Android purchases |
ios product | The Product-ID for iOS purchases |
Additional header types
Column Header | Description |
---|---|
unpublish date | Optional date that is set as the date an issue will be unpublished at (date or date&time, see publication date formats below) |
issue description | The description of the issue in the Purple Manager |
issue number | The issue number in Purple Manager, mostly used for entitlement purposes |
web product | The web product id in Purple Manager |
custom[xyz] | Can be used to specify custom property "xyz" in Purple Manager. Each custom property requires a separate column. |
The issue name is used as the unique identifier for the publication and therefore has to be unique within a publication.
A file can be referenced from more than one line in the CSV file. However, the Purple Importer requires a unique one-to-one relationship between a CSV line and a file reference. In order to support multiple references to the same file, the Importer does some preparation work while collecting the output data from sFTP. The importer breaks the many to one relationship between the csv lines and each file reference by creating a unique copy of the file for each individual csv line. This is done by appending a unique (within the scope of the csv file), repeatable string to the file name. When this is done, the original file is deleted. This is necessary for the importer to work properly. These copies are visible on the sFTP and should not be touched.
The following date formats are allowed:
- yyyy-MM-dd HH:mm:ss
- yyyy-MM-dd
- dd.M.yyyy HH:mm:ss
- dd.M.yyyy
- dd/MM/yyyy HH:mm:ss
- dd/MM/yyyy
Year abbreviation by two digits (f.e. “18” for “2018”) is also supported for every date format.
The issue access can be specified per issue in the CSV, or globally in the users config.yml-file (only very limited persons have access to that file)
Possible values:
- free (content is available for everyone and visible in the app/web experience
- paid (content is visible but locked and usually unlocked by purchasing it)
- locked (content is avilable to entitled users and invisible until unlocked)
If no explicit value for "access" is given the default mechanism is used to determine if an issue is paid or free content. The default mechanism sets the issue as paid content when any product id (iOS, Android) is set.