AnsweredAssumed Answered

How to map single Database row to multiple xml fields by splitting and looping

Question asked by sriramakrishna.chittabathina302209 on May 9, 2017
Latest reply on Oct 23, 2017 by mani.sethuraman333464

Hi All 
I'm getting a Database value for  REG_CONTRY_PAIR as below

 

E.g :

"AMERICA||ARGENTINA~AMERICA||COLOMBIA~AMERICA||COSTARICA~AMERICA||MEXICO~AMERICA||PERU~AMERICA||URUGUAY~AFRICA||SOMALIA"

   ( actually we don't know how many value pairs will come)

each region and corresponding country pair separated by  ~  and
region and corresponding country separated by  ||

 

I've to split the above row and map to region and corresponding countries separately as below (required output sample)

 

Is there any way in boomi we can do such thing as below?

 

<Region_Countries>
  <Region>
      <Region_Name>AMERICA</Region_Name>
      <Countries>
            <Country>ARGENTINA</Country>
            <Country>COLOMBIA</Country>
            <Country>COSTA RICA</Country>
            <Country>MEXICO</Country>
            <Country>PERU</Country>
            <Country>URUGUAY</Country>
      </Countries>
  </Region>
  <Region>
      <Region_Name>AFRICA</Region_Name>
      <Countries>
         <Country>SOMALIA</Country>

         <Country>...</Country>

         <Country>.....</Country>
      </Countries>
   </Region>
</Region_Countries>  

 

 

 

Many Thanks,

Outcomes