Overview
The <body> element is the most fundamental mapper instruction in Integration Manager. It copies a field value from the incoming record to the outgoing record. You can map fields one-to-one, rename them, or limit their length with maxLength.
Complete XML Examples
Basic Field Copy (same name in and out)
When out is omitted, the field keeps its original name:
<mappers>
<loadMapper id="productMapper">
<body in="sku"/>
<body in="label"/>
<body in="attribute1"/>
</loadMapper>
</mappers>
Renaming Fields
Use in and out to map a source field to a differently named target field:
<mappers>
<loadMapper id="customerMapper">
<body in="customer_id" out="customerId"/>
<body in="customer_name" out="label"/>
<body in="email_address" out="attribute1"/>
<body in="phone_number" out="attribute2"/>
<body in="region_code" out="attribute3"/>
</loadMapper>
</mappers>
Limiting Field Length with maxLength
Use maxLength to truncate values that exceed a given character limit:
<mappers>
<loadMapper id="productWithLimitsMapper">
<body in="sku" out="sku"/>
<body in="price" out="attribute1" maxLength="100"/>
<body in="description" out="attribute2" maxLength="255"/>
<body in="category" out="attribute3" maxLength="50"/>
</loadMapper>
</mappers>
How It Works
-
inattribute -- specifies the field name in the source data (CSV column header, JSON key, or Pricefx object field). -
outattribute -- specifies the target field name in the Pricefx object. If omitted, the value ofinis used as the output name. -
maxLengthattribute -- truncates the mapped string value to the specified number of characters. Useful for preventing data truncation errors in Pricefx. -
The
<loadMapper>wrapper is used for bulk data load operations (pfx-api:load). For upsert operations, use<integrateMapper>instead.
Common Pitfalls
-
Forgetting
out: Whenoutis omitted, the output field name defaults to theinvalue. This is convenient for same-name mappings but can cause confusion if you expect automatic camelCase conversion. -
Case sensitivity: Field names are case-sensitive.
"Sku"and"sku"are different fields. -
maxLength on numeric fields:
maxLengthoperates on the string representation. Applying it to numeric fields may produce unexpected truncated numbers. -
One mapper per file: Always put exactly one mapper definition per file. Do not define multiple
<loadMapper>or<integrateMapper>elements in the same file. -
Mapper ID uniqueness: Each mapper
idmust be unique across all mapper files. Duplicate IDs will cause one to silently override the other.