====== Sets - Import data from CSV ======
This LRT can be used to import property sets.
==== Prepare CSV file ====
Here is an example of CSV file which can be used for importing sets.
name;code;description;setType;guarantors;guarantorRoles;roles
Office 365;Office_365;description1;LICENCE;jakub.vesely;Office_365_guarantor|Licence_guarantor;Office_365
Cars;Cars;description2;PROPERTY;jana.novakova|jakub.vesely;Cars_guarantor;Car
The names of the columns are fixed and you cannot change them.
Overview of attributes:
* 'name' is the descriptive name of the set - must not be null
* 'code' is the technical name of the set, must be unique - must not be null
* 'description' is only a descriptive attribute
* 'setType' may be either LICENCE, or PROPERTY - must not be null
* 'guarantors' is a list of direct set guarantors (usernames of identities)
* 'guarantorRoles' is a list of set guarantors by role (codes of roles)
* 'roles' is a list of set roles, i. e., role which assign property from the imported sets (codes of roles)
Columns 'guarantors', 'guarantorRoles', and 'roles' can be multivalued - use the pipe sign ('|') to separate the values.
CzechIdM uses by default utf-8 encoding. If your input file is encoded in different encoding, or if you experience some issues with non English characters, you may set different encoding in configuration of import long running task. Examples of other used encodings might be windows-1250, or windows-1252
Update is not supported. Only new sets can be created by import.
==== Create new LongRunningTask ====
Now we will create the new LongRunningTask (LRT). As shown in the picture, go to Settings → Task scheduler → Scheduled tasks and hit green "Add" button to add new LRT.
==== Fill all attributes ====
Now we need to create new LRT with these attributes:
- Task type - **Import sets**
- Import csv file - dropzone to select or drop csv file
- Import file encoding - the encoding of the csv file
- Column separator - separator of columns in csv file
==== Run the task ====
Now we just need to hit run.
{{:tutorial:adm:aaaaaaaa6.png?100|}}
Once the task is finished, the sets will be imported.