I'm trying to use Mapper 2.0 on an EDI FTP transfer. My source data is tabular and doesn't match the shape of the EDI document very well. I need to build an "N1" loop of 3 elements (in non-EDI terms, this is an array of objects with the same properties on each object). My source data isn't an array that I can straightforward map array-to-array, instead I need to transform the data in the mapping.
Did I mention I'm trying to avoid script to transform my source data? Yeah, I am - I want to see how far mapper 2.0 can get me in avoiding scripting.
So the problem is, I can defined mapping for the N1 loop and add sub mappings, but that will only create a single element in the array and I need to create 3. I'm not seeing anyway to accomplish what I need, but thought I'd ask here in case there is a trick or advanced concept that will do what I need.
Here's my current mapping:
which produces:
...
"hl_shipment": [
{
"n1": [
{
"entity_identifier_code_n101": "ST",
"name_n102": "",
"identification_code_qualifier_n103": "67",
"identification_code_n104": "TBD - UPS Warehouse Code"
}
]
}
...
What I need is a way to create:
...
"hl_shipment": [
{
"n1": [
{
"entity_identifier_code_n101": "ST",
"name_n102": "",
"identification_code_qualifier_n103": "67",
"identification_code_n104": "TBD - UPS Warehouse Code"
},
{
"entity_identifier_code_n101": "BY",
"name_n102": "",
"identification_code_qualifier_n103": "asd",
"identification_code_n104": "TBD"
},
{
"entity_identifier_code_n101": "XX",
"name_n102": "",
"identification_code_qualifier_n103": "666",
"identification_code_n104": "Maiden Rules!!"
}
]
}
...
Any ideas? Again, I know I can transform my source to better support this, but I'm hoping the new mapper as a way to accommodate it.