CSV Import
Aptono can import data via CSV files. To import a csv file, Aptono first needs to have an import format. This can be defined by collection administrators in the collection settings window (see here). Go to the 'Import formats' section and click on the 'Add new format' button:
A new format will appear in the list. Click on the settings icon to open the settings window:
Add a name to allow users to recognize when to use this format. The 'Start row' option indicates on which line the data starts. This can be used to skip any header data in the csv file. Then specify the delimiter used in the csv file.
All fields in the collection that can be imported via csv will be shown in a list. A mapping can be specified that indicates how Aptono should import data. There are three options:
- Value from csv: specify which column contains the data for this particular field.
- Default value: the default value of the collection template will be used. Note that this value should valid, otherwise the record will be rejected.
- Predefined value: fill in a value that should be used for all rows.
Select a column number, to indicate in which column the current field can be found.
If there are fields in the collection that cannot be imported via csv, they will not be shown here. Aptono will attempt to fill in the default values as defined in the record template. For this to be successful, the default values need to be valid.
Missing data in csv data
Aptono will scan all rows of the csv file, starting from the 'Start row'. It will attempt to create records with the data that is found. Some csv files might not have all rows filled in. You can specify how to deal with missing data by choosing one of three options in the 'Replacement' field:
- None: the row will not be converted to a record and an error message will be shown.
- Default: use the current default value in the record template to fill in missing data.
- Custom value: indicate which value to use.
Using the csv import format
To import a csv file, close the format settings window to back to the collection settings window. In the 'Existing formats' table, click on the 'Use' button of the created csv import format:
A file selection window will be shown. Select a csv file and open it. Aptono will start analyzing the csv file. A result window will be shown. If there were no errors, the result will look as follows. Click on submit to send the data to the server:
If there were errors, these will be shown in the result window. You can choose to abort the operation, or to send the records that were successful.
After the data was send to Aptono, it will be checked by the validators of the record template. There it still might be rejected. If not, the records will be added to the collection.
Field data type import format
Field data type | Format |
---|---|
Text, Markup, Folder, Password, Unique id, Email, Url | Regular text |
Decimal, Currency | Numbers using a decimal dot (.) |
Integer, Day / Week / Month / Quarter / Year number | Integer numbers |
Date, Point in time | Year-month-day Hour:Minute:Second |
Year-month-dayTHour:Minute:Second | |
Year-month-dayTHour:Minute:Second+Timezone (either 01:00 or CST) | |
Year-month-dayTHour:Minute:Second Timezone (either 01:00 or CST) | |
ISO 8601 without timezone | |
ISO 8601 with UTC timezone | |
ISO 8601 with offset | |
RFC 3339 with fractional seconds and UTC | |
All above but with day first | |
All above but no leading zeros | |
Boolean True | Any of the following, case insensitive: 1, yes, y, confirm, confirmed, accept, accepted, on, enable, enabled, valid, success, exist, exists, positive, active |
Boolean False | Any of the following, case insensitive: 0, no, not, n, deny, denied, reject, rejected, off, disable, disabled, invalid, fail, failure, nonexistent, negative, inactive |
Right tags | Regex match: r"Righttag: (\w+), level: (\d+)" |
Reference to other record | Uuid of the record |
Other | Not supported |
Importing multi value fields
To import multivalue fields, make sure that the data for the separate values is in one column, separated by '<!&&!>'. For example: value1 <!&&!> value 2. This marker tells Aptono that there are multiple values in the column.
Limitations
Currently the csv import function can only be used by collection administrators. In the future a widget will be added such that collection visitors can use the created templates as well.