You can map response fields into a relational structure of output groups and fields for output.
The response shown in the Field Mapping tab shows the hierarchical structure of the data that comes from the source.
When you select fields in the Response area, the fields appear in the Output Fields area in a relational structure with generated primary keys and foreign keys. For example, in the Response Fields area you select First_Name and Last_Name, and then you select Email_Address, which is located under a different parent in the hierarchy. In the Output Fields area, the structure is relational with assigned primary and foreign keys, as shown in the following image:
Consider cardinality when you map response fields to the relational structure. Cardinality imposes constraints on the number of times a field or group can occur at a specific point in the XML structure. A cardinality of 0-many means the field or group can have zero to many occurrences. A cardinality of 1-1 means a field or group is required and can only occur once.
If you map a field with 0-1 or 1-1 cardinality, the first parent node that has 0 to more than 1 cardinality is also mapped. If a parent group with 0 to more than 1 cardinality does not exist, the system creates a group. For example, if you map Email_Comment, which has cardinality of 0-1, the Email_Address_Data group, which has cardinality of 0-many, is automatically mapped.
Packed fields
You can pack fields to reduce the number of output groups for a request message. You can mark fields to be packed when you configure field mapping. When you run the
mapping
task, the task packs the element and its children into a single XML string.
Fields can come from the source already marked for packing. The Pack icon displays next to elements marked to be packed. To pack a field, click the Pack icon, as shown in the following image:
You cannot pack fields that are children of packed fields.
In the following image, you can see that the Phone_Data element is packed:
You can use XPath expressions to mark multiple fields for packing or unpacking. In the Response Fields area, click the arrow and select Mark Packed Structures, as shown in the following image:
In the following image, all fields that have ID as a child are marked to pack: