AnsweredAssumed Answered

Source XML documents not mapping all fields to destination?

Question asked by charles.rowan674762 on Aug 24, 2017
Latest reply on Sep 6, 2017 by daniel.santana

First time poster, I have a question with regards to a custom function - I cant see to get multiple entries output to a flat file.


The XML out of SucessFactors looks like this:

 

  <phone_information>
   <created_by>23333</created_by>
   <created_on_timestamp>2017-07-21T18:25:35.000Z</created_on_timestamp>
   <isPrimary>true</isPrimary>
   <last_modified_by>23333</last_modified_by>
   <last_modified_on>2017-07-21T18:27:09.000Z</last_modified_on>
   <phone_number>1 213 895 4352</phone_number>
   <phone_type>B</phone_type>
  </phone_information>
  <phone_information>
   <created_by>23333</created_by>
   <created_on_timestamp>2017-07-21T18:25:35.000Z</created_on_timestamp>
   <isPrimary>false</isPrimary>
   <last_modified_by>23333</last_modified_by>
   <last_modified_on>2017-07-21T18:27:09.000Z</last_modified_on>
   <phone_number>215-111-2222</phone_number>
   <phone_type>F</phone_type>
  </phone_information>


And I am trying to map the multiple phone numbers (work, business_mobile, business_fax) from a SucessFactors XML profile to a flat file for another system. The type of phone number is identified using the <phone_type> node.


my function looks like this:

 

 

and my javascript in the function is:

if (phone_type == "B") {
  phone_number_work = phone_number;
} else if (phone_type== "F"){
  phone_number_fax = phone_number;
}
else if (phone_type == "BM"){
  phone_number_businessmobile = phone_number;
}
else{phone_number = " ";
}

 

However, despite the mapping, I only have been able to map one phone number to the destination file, despite the existance of multiple numbers assigned to an employee.

 

Can anyone give me some insight into this?

Thanks.

Outcomes