How can I import data from excel with links between items?

Overall workflow

First you import all the data. For that each category in Matrix needs to be in one excel sheet or or file. See Importing data from Excel

Once all data is imported you re-create the links.

Preparation

Preparation Matrix

First you need to enable the excel importer. 

Note: Matrix needs to install a small add-on which allows you to create the links once you imported the data. 


Changes to project configuration

  • Each category which should be imported and linked needs to have a text field "legacy id"
  • Each category which has downlinks to another imported category needs to have a text field "legacy down"

The categories, fields per category and tracebaility rules need to be created before importing.

Preparation Excel

The excel needs to be prepared that each field in Matrix which should be imported matches a column in the excel (see Importing data from Excel). Specifically your excel 

  • needs to have a column with the legacy id (not the legacy id's need to be unique over all columns)
  • needs to have a column with the downlinks (as comma separated list of legacy id's)

Tip: if you are unsure on the formatting of the excel, the best way is to fill an item in your category and than export it through the REPORTs to excel. In general what you can export you ca also import again int he same format (with some exceptions)

Importing

First you import all items in all categories (see Importing data from Excel).

Once the data is imported you have something like this. In this example we have two categories REQ and SPEC, the REQ items can have downlinks to SPEC items

A SPEC might look like this

The REQ like this

So the REQ-41 (aka my_req_00) knows that it needs to be linked to some SPECs with legacy ids my_spec_id_01 and my_spec_id_03 

Recreating the links

In order to re'create the links you need to write small configuration script which describes in which categories which fields contain legacy ids and downlinks

Configuration

In the admin client create or edit the project setting reLinkConfig

The setting contains a list of rules like this

{
    menuEntry:string // e.g. "relink" what to show in menu if "" nothing will be shown == rule is disabled
    category: string // e.g. "REQ": parent category from where links are created
    linksField: string // e.g. "legacy down": name of field which contains comma separated links into Matrix or external tool
    downCategory?:string // e.g. "SPEC": to where to create links (if empty no downlinks will be created)
    downLegacyField?:string // e.g. "legacy id": name of legacy field for identification against links
}


So for example it will look like this, defining two rules

Once the rules have been defined you can refresh the client and select a folder for which you want to create the links.

There in the the menu you have the tool to create the links:

Note: Once the links have been create they are removed from the legacy downlink field, so you can immediately see if some links could not be created.