Page tree

MagicDraw 2022x Documentation


On this page

Introduction

The Excel/CSV Import dialog allows you to specify settings before importing content from an Excel/CSV file to the model. This mechanism allows you to create mapping between an Excel or CSV file column and target element properties. Once you specify mapping options, you can save your map for reuse or import it as an existing one. 

Opening the Excel/CSV Import dialog

To open the Excel/CSV Import dialog


  • On the main menu, select File > Import From > Excel/CSV File > Import Using New Map.
    The Excel/CSV Import dialog opens.


Description of the Excel/CSV Import dialog areas

The Excel/CSV Import dialog consists of the following areas:

The main areas, highlighted in orange, in the Excel/CSV Import dialog: select file, mapping options, and mapping.

Select the Excel/CSV file area 

The Select Excel/CSV file area allows you to select the Excel or CSV file from your file system or from your model if the Excel or CSV file is attached to a project. How to attach the file to a project >

The Select Excel/CSV file area contains the buttons described in the following table.

ButtonDescription

(mandatory)

If you select From file system, the Open dialog opens. The selected file path is displayed in the Excel/CSV File field.
If you select From model, the Select Excel/CSV file dialog opens. The selected attached file name is displayed in the Excel/CSV File field.

Refreshes the mapping area after changing the file.


Mapping Options area

The Mapping Options area allows you to specify mapping options. These options define how file columns meet the element properties after data import. The following table lists all available options and provides their descriptions in detail.

Mapping optionDescription

Import Type (mandatory)

Select either elements or instances you want to create in the model after data import.

Element Type (mandatory)

Click and select the type of the elements that are created in the model after data import.

Instance Classifier (mandatory)

Click and select the element which is set as classifier for all imported instances.

Stereotype

Click and in the Select Stereotype dialog select one or more stereotypes to apply them for created elements after the import.

You can select stereotypes only if the Element Type option value is selected.

Properties to Map (mandatory)

Click and in the Properties to Map dialog select one or more properties of the element type. The imported elements contain selected properties and their values are filled with data from the Excel or CSV file.

You can specify properties only if the Element Type option value is selected.

Nested Properties to Map (mandatory)

Click and in the Nested Properties to Map dialog select one or more nested properties of the Instance Specification. The imported instances contain selected properties and their values are filled with data from the Excel or CSV file.

You can specify nested properties only if the Instance Classifier option value is selected.

Target Scope

Click and in the Select Owner dialog select or create the element that contains the created elements after the import.

To create a new element using the Select Owner dialog


a. Click the Creation Mode button.
b. Click the Create Owner button.
c. Select an appropriate element from the list.

Search for Elements In

Select the search scope of imported elements:

    • Target Scope Only (default) - searches for an imported element only under the element selected as the Target Scope option value. If you have to deal with a large a scope of information, this option increases the import speed.

    • Target Scope Recursively - searches for imported elements recursively from the element which is selected as the Target Scope option value. If you have to deal with a large a scope of information, this option might slowdown the import speed.
Search for References In

Select search scope of elements that are referenced with imported elements:

    • Target Scope Only (default) - searches for referenced elements only under the element selected as the Target Scope option value. If you have to deal with a large a scope of information, this option increases the import speed.
    • Entire Model - searches for referenced elements recursively from the Model package. If you have to deal with a large a scope of information, this option might slowdown the import speed.
Sheet Select the Excel file sheet you want to import. The first sheet is selected by default.
It is available only for Excel files.
First cell Select the Excel file cell you want to start importing from. The first cell filled with data is read by default. If the selected sheet is empty, it reads from the A1 cell.
It is available only for Excel files.
CSV Delimiter

Select the delimiter of the CSV file from the drop-down list. If you want to specify a custom delimiter in the next box, select Other. By default, the comma (,) is selected.
It is available only for CSV files.

Identification Property

Select the property that identifies if the imported element already exists in the model. It allows to avoid element duplication.

Select the Default value to identify elements by their Name and requirements by their ID. The rest of the values are the same as those selected in the Select Properties to Map option but only Primitive data types.

If the imported element Identification Property option value matches with an already-existing element property, the identified element properties are updated.

Identify Relationship (end) Source by:

This option is displayed only if any kind of direct relationship is selected as the Element Type option value.

Click and select the property from the list that identifies the source of the relationship end.

Select the Default value to identify relationships by their name or id. Select <UNSPECIFIED > value to create the same relationship between the same elements.

The mechanism identifies relationships according to the following rules:

  • If more than one relationship is found with the same Identification Property, the first is updated.
  • The mechanism identifies relationships according to Identification Property option value first unless the Default value is selected and relationship ends are specified with particular tag or property.
  • If it doesn't find anything or find more than one relationship, then the mechanism proceeds to search according to the Identify Relationship (end) Source by option value.
  • If you import two different relationships (e.g. Satisfy and Dependency) that ends are of different types, this option allows you to select only those properties and tags that are common for both of them.
Identify Relationship (end) Target by:

This option is displayed only if any kind of direct relationship is selected as the Element Type option value.

Click and select the property from the list that identifies the target of the relationship end. Select the Default value to identify relationships by their name or id. Select <UNSPECIFIED > value to create the same relationship between the same elements.

The mechanism identifies relationships according to the following rules:

  • If more than one relationship is found with the same Identification Property, the first is updated.
  • The mechanism identifies relationships according to Identification Property option value first unless the Default value is selected and relationship ends are specified with particular tag or property.
  • If it doesn't find anything or find more than one relationship, then the mechanism proceeds to search according to the Identify Relationship (end) Source by option value.
  • If you import two different relationships (e.g. Satisfy and Dependency) that ends are of different types, this option allows you to select only those properties and tags that are common for both of them.
First Row Contains Headings check boxClear the check box if your Excel/CSV file does not contain headings. The check box is selected by default.


Mapping area

The Mapping area allows you to manage mapping between element properties and Excel/CSV file columns by creating new mappings, re-mapping, or deleting them:
          -  To create a new map or re-map individually, drag columns from the left tree/right tree onto columns in the right tree/ left tree.
          -  To create a new map or re-map all columns in the ordinal position, click at the bottom of the mapping area.
          -  To delete mapping individually, select an appropriate map and click at the bottom of the mapping area.
          -  To delete all mappings, click at the bottom of the mapping area

If you do not define your own mapping (that is, the mapping area is empty), the columns by default are mapped on the ordinal position.

The hashtag (#) column from the modeling tool table is not included in the mapping.




  • No labels