Contact Us 1-800-596-4880

Defining Metadata Using Edit Fields

When defining or updating input and output metadata for the different data types supported by Anypoint DataMapper, you will use one of several very similar editors to create the structure and define fields, elements and attributes. Any of these editors is opened by selecting User Defined for the metadata source, and then clicking Edit Fields.

image2013-4-10+12:54:45

This document describes the use of the editor for key/value maps. The editors for other structured data are substantially similar, and the editors for flat data like CSV files are similar but simplified.

check 1 This document assumes the reader is familiar with the DataMapper Transformer. Consult the DataMapper User Guide and Reference document for details.

About the Examples

The illustrations used in this document are taken from the discussion "Shortcut: Creating Output Metadata based on Defined Input Metadata" in Defining DataMapper Input and Output Metadata. If you want to reproduce the tasks described here, follow the steps in the example in that discussion to set up your environment.

You can edit data structure definitions (i.e. fields) in an existing DataMapper transformer within the Input and Output panes of its DataMapper View. Consult Updating Metadata in an Existing Mapping for details.

Adding a Field

  1. Click contacts to select the parent element for the new field. (This step does not apply when working with flat data like CSV or fixed width files.)

  2. Click the (plus) icon in the upper-left corner of the editor panel to create a new field under the selected parent. Alternatively, right-click the existing parent and select Add. 3-2-edit.indiv.fields A new field is inserted.

  3. Click the field label to edit the name of the field, then press Enter.

    4-2-edit.indiv.fields

    === Alternative Method

  4. In the Edit Map Fields panel, right-click the parent element in the editor pane.

  5. Select Add to create a new field (see below, left; the new field is labeled field0 ).

  6. Click the field label o edit the name of the field, then press enter.

Renaming a Field

  1. To rename a field, click the field name.

  2. Type in the new field name, then press enter.

Modifying a Field’s Type

To change the type of a field:

  1. Click the field’s type in the Type column.

  2. Use the drop-down menu to select a new field type.

    5-select.field.type
  3. Click outside the type menu to deselect the type value.

Deleting a Field

Use one of the following three methods to delete a field.

  • Right-click the field name, then select Remove from the drop-down menu.

  • Click to select the field, then press the red "X" icon in the upper-left corner of the editor panel.

  • Click to select the field, then press Delete (not Backspace). (On a Mac keyboard, press fn+delete.)

Changing the Order of Fields

To re-order the fields, such as changing the order of columns in a CSV file:

  1. Select the field to be moved to a new position.

  2. Click the up and down arrows until the field is in the desired position.

  3. Click OK when finished.