Contact Us 1-800-596-4880

Defining Metadata Using Edit Fields

Mule Runtime Engine versions 3.5, 3.6, and 3.7 reached End of Life on or before January 25, 2020. For more information, contact your Customer Success Manager to determine how you can migrate to the latest Mule version.

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 Edit Structure…​.

edit_structure

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.

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 sign 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

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

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

  3. 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.