Using the Mapper

The mapper opens when you click an input field in the Input tab.

Note: If the schema contains an array with only one element, the field for that element is not marked as required (does not have a red asterisk against it) in the Mapper.
Note: The in and new attributes are treated as special characters if used in the schema that you enter in the Input or Output tab of a REST activity or trigger. For example, mappings such as $flow.body ["in"] and $flow.body ["new"] are not supported. If an imported app contains these attributes, after the app is imported into TIBCO Cloud Integration- Flogo (PAYG), it results in runtime errors.

You can only map one element at a time, be it an individual field or an array of primitive data types or non-primitive data types. When mapping array of primitive types, you map the array root and its containing elements will automatically get mapped. When mapping an array of non-primitive data types, you must first map the root array, then map each element of the non-primitive data type individually. For example, to map an array named Employee Records containing Employee objects that is made up of employee name, employee ID, and department, you have to first map Employee Records, then map each element of the Employee object individually.

Here is an example of what the mapper looks like.

In the example above, to map the message field in the LogMessage activity Input tab, you would need to do the following:

Procedure

  1. Click the message field to open the mapper in the gray box to its right.
    The mapper opens to the right with the selected field (message) displayed over a text box in which you can either manually enter a value for the field or map it to an field from the output of a preceding activity.

    In the example shown above, the mapper opens for data entry or mapping for the message field. You can see that the output schema of the preceding activity and the trigger (InvokeRESTService and ReceiveHTTPMessage respectively) appear under the left Search bar. Function categories are displayed under the right Search bar. You can expand any of the function categories to display the functions in that category. Clicking on a function adds the function in the text box for you to use when mapping.

  2. You have the option to manually type in the data in the text box or map it to one of the elements in the output of a preceding activity or trigger.
  3. To map an element from the output of a preceding activity (InvokeRESTService in the example above), expand its node and click on the desired element. The mapping appears in the text box.