Imports
Imports allow you to integrate your existing data into your back office using templates in CSV format. They also allow you to ensure the integrity of imported data by verifying the set of business rules defined in your specifications.
Composition
An import is composed of a file, resources, a data, a state, a progress, an author, and a set of errors.
The file is a file in CSV format containing the data and headers of the data to be imported. You must follow the file structure to import your data. To do this, you can download templates. For example, if you want to import users, go to the list of users, click on Import users, and then click on Download CSV template.
Resources are the set of JSON format resources that you want to import. If no file is provided with the import, this data will be used.
The author is, as the name suggests, the author of the import.
The data is the resource you want to import. For example, tasks, users, meetings, etc.
Each import is done as a background task. You can track their advancement with progress.
The state is the current state of your import. Possible states are:
- In progress
- Finished
- Error
Errors are the set of business errors in your import file. For example, it could be an invalid uniqueness constraint (two identical rows). Each error comes with a line number to help you correct it. If your import is in error, you need to create a new one with a fixed file.
ℹ️
It's also worth noting that no data is imported if your file contains errors.
Case study
Imagine you want to import users into your application. To do this, you download the associated template. So you get a CSV file CSV which looks like this:
Email,Password,First name,Last name,Avatar,Locale,Time zone,Role,Teams
,,,,,,,,
,,,,,,,,
In order to import your users, you fill in the template with at least the required fields.
Email,Password,First name,Last name,Avatar,Locale,Time zone,Role,Teams
[email protected],,John,Doe,,English,UTC,Admin,Paris;London
[email protected],,Jane,Doe,,French,Paris,Admin,Paris;London
ℹ️
Association fields such as Role or Teams must be filled in by their designation (in this case Admin or Paris).
ℹ️
Multi-valued fields such as many-to-many associations, arrays, or flags must have data separated by a ;
.
Then, all you have to do is send the file from the interface and follow the progress of your import.