Show TOC

Mapping DataLocate this document in the navigation structure

Use

When you connect an element to an input port of a data service, you need to map the data fields from the input element to the fields of the data service. You map data fields to define which fields of the input data are the correct sources of data for the fields of the data service.

When you drag out from the input port of a data service to create an input element, or if you use the Compose task panel to add a view element to the Design board and manually connect it to the input port of a data service, the fields are mapped automatically.

For example, you may have a data service that expects to receive data for the Bank Country and Max Rows fields. If you create a form view by dragging out from the data service input port, these two data fields and their associated controls are added automatically to the form view and mapped to the corresponding data service fields.

However, if the input element's dataset does not match that of the data service, if you want to change the automatic field mapping, or if the dataset is clustered, you need to manually map the data fields of the input element to the fields of the data service. For a clustered dataset, you also need to map any child nodes of the dataset as required (the root node is mapped automatically). You do this using the Map Data dialog box, as described in the following procedure.

Prerequisites

On the Design board, you have connected an element to an input port of a data service.

Procedure
  1. Right-click the connecting line between the element and the input port of the data service, and from the context menu choose Map Data .

  2. Map the fields in one of the following ways:

    1. If you are mapping fields in a flat dataset, in the Assigned Value column, specify each field that you want to map to each Target Field of the other element.

    2. If you are mapping fields in a clustered dataset:

      1. In the top part of the dialog box, drag from the Source node (the node containing the data for output) to the Target node (the node that receives the data). A mapping line is created between the two nodes, and any fields of the same name are automatically mapped to each other. Normally, the top nodes are mapped automatically.

        You can map directly to any level of a clustered dataset, as long as the parent nodes are mapped. You can also map from a table to a linked lower-level table by mapping directly from the upper node to the subnode, so that the sub-table shows only the lower-node information without displaying the entire node/table.

        Note

        When the child nodes of the source and target are identical, you can use the Map All button in the toolbar to automatically map all children of the selected mapped node.

      2. In the tree, select the node whose fields you want to map.

      3. In the table at the bottom of the dialog box, in the Assigned Value column, specify each field that you want to map to each Target Input Field of the other element. If the list of fields is longer than the bottom pane, click the Show All link at the bottom left to enable a scrolled display of the list.

        Note

        To remove a mapping, select the mapping line and click the Unmap button in the toolbar (or choose Unmap from the context menu). If you delete a parent node mapping, any relevant child node mappings are also deleted. If you delete a child node mapping, the parent node mappings are not deleted.

    3. To define which data to copy from the source dataset at runtime, select one of the options from the Select mode dropdown list at the bottom:

      • All rows : Copies all rows from the source dataset to the corresponding rows in the target dataset.

      • Current data row : Copies the current row (row in which the cursor is located) from the source dataset to the target dataset.

      • Selected data rows: Copies the selected rows (highlighted rows) from the source dataset to the target dataset.

    4. Click Close .

For more information about the options in the Map Data dialog box, see Map Data Dialog Box in the Visual Composer Reference Guide .

Result

The fields are mapped, and at runtime the field data is transferred to the data service according to the mappings you defined.