AnsweredAssumed Answered

Internal Profile list to differents fields on destination profile - Map

Question asked by polyana.f.barbosa on Nov 15, 2017
Latest reply on Nov 15, 2017 by leif_jacobsen

Hi all,

Im new with boomi. And i have the situation:

My map input is something like...

 

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<inputxml>
<table1>
<item>
<field1>000010</field1>
<field2>000</field2>
<field3>00</field3>
<field4>YB00</field4>
</item>
</table1>
<table2>
<item>
<table2field1>000</table2field1>
<table2field2>A</table2field2>
<table2field3>32800.000</table2field3>
</item>
<item>
<table2field1>0000</table2field1>
<table2field2>B</table2field2>
<table2field3>0.000</table2field3>
</item>
<item>
<table2field1>0000</table2field1>
<table2field2>C</table2field2>
<table2field3>100.000</table2field3>
</item>
<item>
<table2field1>0000</table2field1>
<table2field2>D</table2field2>
<table2field3>100.000</table2field3>
</item>
<item>
<table2field1>0000</table2field1>
<table2field2>E</table2field2>
<table2field3>7.000</table2field3>
</item>
<item>
<table2field1>0000</table2field1>
<table2field2>F</table2field2>
<table2field3>100.000</table2field3>
</item>
</table2>
<table3>
<item>

.
.
.

</inputxml>

 

 

And i need an output json that can have the value of each occurence of table 2 (for example). Like this one:

 

[
{
"value1" : "00000",
"value2" : "7.000" (mapped from table2field3 WHEN table2field2 equal to "E")
},
{
"value1" : "00000",
"value2" : "100.000" (mapped from table2field3 WHEN table2field2 equal to "C")
},
{
"value1" : "00000",
"value2" : "32800.000" (mapped from table2field3 WHEN table2field2 equal to "A")
}
]

 

Please, could you help me to know how make that? I tried a scripting function in the map shape, but thats not working. I tried the scripting like this:

 

if (table2field2 == "A") {
value2=table2field3;
};
if (table2field2 == "C") {
value2=table2field3;
};
if (table2field2 == "E") {
value2=table2field3;
}

 

Thanks in advance.

Outcomes