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. A set whose code already exists is skipped.
Each row is imported as a whole. If any listed guarantor, guarantor role or role is not found, the row fails and the set created for that row is removed.
The roles listed in the
roles column are created as set roles and run the standard set role validation. Linking a role that is already assigned to users requires the set to have enough free items for them; otherwise the set role fails with SAVE_SET_ROLE_NOT_EXECUTED_TOO_MANY_USERS. Since an imported set starts with no items, import the property for such sets separately. Since version 14.1.0 the import also starts the Assign missing properties and licences task for each created set role.
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
