Memority's CSV connector can import organizations from a CSV file stored on the SFTP storage of the tenant. Some prerequisites must be met on the file and on the tenant before the import runs.
This page explains how the CSV organization import works in Memority and the prerequisites required to import organizations from a CSV file.
Definitions
What objects can be imported ?
The connector imports organizations of one organization type. Each row of the file is one organization. The import also builds the hierarchy of the organizations from a parent code column.
To import identities and attach them to these organizations, use the CSV Identity Import plugin.
Where is the CSV file read from ?
From the SFTP storage of the tenant, or from the portal. You upload the file to a folder of the SFTP storage that depends on the organization type, or you upload it directly in the portal when you run the import task.
Are organizations missing from the file deactivated ?
No. The import only creates and updates organizations. An organization that is missing from the file does not change. To deactivate an organization, fill its endDate column.
A file can therefore contain all organizations, or only some of them.
Can Memority write back to the CSV file ?
No. The connector only imports organizations into Memority. After each run, the file is archived and an error report is produced.
Memority CSV connector
File prerequisites
|
ID |
Prerequisite |
|---|---|
|
FILE1 |
The file uses |
|
FILE2 |
The file is encoded in UTF-8. |
|
FILE3 |
The first row of the file is a header row with the column names. |
|
FILE4 |
On the SFTP storage, the file has the name entered in the plugin form and it is in the folder |
|
FILE5 |
No value contains a line break, even inside quotes. |
A sample file shows the expected columns and formats. The plugin generates it in the project (_sample-import-csv-organization-<organizationType>.csv), and you can also download it from the portal, on the import task.
Data prerequisites
|
ID |
Prerequisite |
|---|---|
|
DATA1 |
Every row has an |
|
DATA2 |
A code matches at most one organization of the organization type on the tenant. |
|
DATA3 |
The |
|
DATA4 |
Dates use the format |
Expected organization type
A new tenant has only the root organization type. This type holds the root organization only: you cannot import organizations into it. Create a new organization type first, in im/idm/src/main/resources/OrganizationType/.
|
ID |
Prerequisite |
|---|---|
|
TYPE1 |
The organization type has the attributes |
|
TYPE2 |
The organization type has the attributes |
|
TYPE3 |
|
CSV Organization Import plugin
Memority provides a plugin in the MIT Plugin Store that configures the CSV organization import. The plugin generates all the configuration files that your tenant needs.
Prerequisites
In addition to the common plugin prerequisites, this plugin requires:
|
Prerequisite |
Description |
|
|---|---|---|
|
1 |
Existing organization type |
The plugin imports organizations into an organization type that must already exist (for example |
Installation
The plugin is installed with the standard procedure described on the Memority Plugins page. This section only gives the information that is specific to the CSV Organization Import plugin.
Installation mode: repeatable with distinct values. You can install the plugin once per organization type: each installation requires a different organization type.
Plugin form parameters
All four fields are mandatory and have no default value.
|
Parameter |
Description |
Example |
|
|---|---|---|---|
|
1 |
Import name (FR) |
Name of the import task in the portal, in French. 2 to 100 characters. |
Import des organisations |
|
2 |
Import name (EN) |
Name of the import task in the portal, in English. 2 to 100 characters. |
Organization import |
|
3 |
Organization type |
Identifier of the existing organization type that receives the imported organizations. It starts with a lowercase letter, followed by letters or digits (for example |
|
|
4 |
CSV file name |
Name of the CSV file to import. Letters, digits, |
|
Secrets
The plugin needs no secret: the import reads the SFTP storage of the tenant. Step 7 of the standard procedure does not apply.
Data import
The plugin generates no data to import. Step 10 of the standard procedure does not apply.
The plugin also generates a sample file, _sample-import-csv-organization-<organizationType>.csv, in the data folder of the project. It shows the expected columns and formats. Do not push it to the tenant: it is not an import file.
What does it do ?
The generated configuration works out of the box, but it may need adjustments for specific client needs.
The plugin generates the complete configuration required for a CSV organization import in just a few clicks.
It reads a CSV file from the SFTP storage of the tenant, then creates and updates the organizations of one organization type and builds their hierarchy. At the end of each run, it archives the file, produces an error report and sends it by email to the user who ran the task.
The plugin supports:
-
Creation and update of organizations. The import never creates duplicates: you can run it again with the same file or with a new file. Unchanged rows are ignored.
-
Matching on the organization code. Matching with existing organizations is limited to the organization type of the plugin.
-
Hierarchy in one run. The rows can be in any order: the import creates the parents before their children. The whole hierarchy is built in one run.
-
Error report and email notification after each run.
-
Manual run. By default, the task runs only when you start it. You can schedule it afterwards.
Imported data reference
|
CSV column |
Required |
Memority attribute |
Notes |
|---|---|---|---|
|
|
Yes |
|
Unique key of the organization. Spaces at the start and end are removed. |
|
|
Yes |
|
Name of the organization. Spaces at the start and end are removed. |
|
|
No |
|
Code of the parent organization. Empty: the organization is attached to the root organization, also on an update. |
|
|
No |
|
First active day, format |
|
|
No |
|
Last active day, format |
Example:
organizationCode;organizationName;parentOrganizationCode;startDate;endDate
HQ;Headquarters;;2024-01-01;
IT;Information Technology;HQ;2024-01-01;
HR;Human Resources;HQ;2024-01-01;2026-12-31
Running an import
-
Upload the CSV file in one of these ways:
-
to the SFTP storage of the tenant, in the folder
memority_import/organization/<organizationType>/, with the file name entered in the plugin form; -
directly in the portal, when you run the task (step 2).
-
-
In the portal, go to Administration → Import tasks, select the task and run it.
-
At the end of the run, you receive an email with the error report.
After the run, the files are in these folders:
|
File |
Folder |
|---|---|
|
Imported file, archived |
|
|
Error report |
|
The error report lists the rejected rows with an error code, a label, a description, details and a date.
To import identities attached to these organizations, run the organization import first. The CSV Identity Import plugin finds the organization of each identity by its organizationCode.
Behavior by case
|
Case |
Result |
|---|---|
|
The |
The organization is created. |
|
The |
The organization is updated: name, parent, dates. |
|
The |
The row is rejected and listed in the error report. |
|
The row has no |
The row is rejected and listed in the error report. The other rows are imported. |
|
The |
The row is rejected and listed in the error report. |
|
The |
The organization is attached to the root organization. |
|
An organization of the type is missing from the file |
Nothing changes: the organization stays active. |
The organization code and name are case-sensitive: it and IT are two different codes.
Technical details
<organizationType> in the generated file names is replaced by the Organization type entered in the plugin form.
Generated files
|
File |
Path |
Description |
|---|---|---|
|
|
|
CSV connector: file path, separator, encoding |
|
|
|
Mapping of the columns, matching rules and reactions |
|
|
|
Import task |
|
|
|
File archive, error report and email notification |
|
|
|
Sample CSV file. It is not deployed. |
Updated files
|
File |
Path |
Description |
|---|---|---|
|
|
|
Adds the name of the import task, in French and English |
|
|
|
Adds the import task to the filter of the import reports |
Troubleshooting
For issues with the Plugin Store itself (plugin not found, installation error), see the troubleshooting section of the Memority Plugins page.
The whole file fails and no row is imported
-
Cause: The file does not meet the file prerequisites (FILE1 to FILE5), so the CSV connector cannot read it.
-
Fix: Correct the file, then run the import again.
Rows are rejected with an unknown parent
-
Cause: The
parentOrganizationCodeis not the code of another row of the file, of an organization of the same type on the tenant, or of the root organization. A parent of another organization type is not supported. -
Fix: Check the parent code. If the parent belongs to another organization type, attach the organization to the root organization or to an organization of the same type.
Children are rejected on a first import
-
Cause: The configuration of the import task was changed to add write thresholds (
idmWriteOperationsThresholdDefinition): the plugin generates the task without them. With write thresholds, all the rows are processed before any organization is written, so the parents created by the same file do not exist yet. -
Fix: Remove the write thresholds from the import task file (
import-csv-organization-<organizationType>-syncTask.xml) and deploy the configuration again. A second run of the same file also imports the rejected children.
Rows are rejected because several organizations match
-
Cause: Several organizations of the organization type have the same code on the tenant.
-
Fix: Correct the
organizationCodein the file, or remove the duplicates on the tenant, then run the import again.
An organization is created instead of being updated
-
Cause: The code in the file and the code on the tenant differ only by case. Codes are case-sensitive.
-
Fix: Use exactly the same code as on the tenant.