Some fields not importing from XML when using Import Sets

jfarrer
Mega Guru

I have an XML feed that I am trying to consume using Import Sets but it is not getting all of the data. As near as I can tell, it is only looking at the XML elements that exist in the first record, but not all of the elements exist in the first record such as address information, but in later records they are there. It only created and populated the fields that exist in the first record. When I made a custom example file with the second record and tried it with that then it created and populated the fields just fine.

Here is an example:


 <ROW>
   <ID>1887</ID>
   <LAST_NAME>EXAMPLE VENDOR</LAST_NAME>
   <CUST_TYPE>VENDOR</CUST_TYPE>
   <BILL_REFERENCE>C123456</BILL_REFERENCE>
   <TAX_CODE>State</TAX_CODE>
   <STATUS>1</STATUS>
   <BILLING_CYCLE>V</BILLING_CYCLE>
   <CUST_NO>C123456</CUST_NO>
 </ROW>
 <ROW>
   <ID>1580</ID>
   <LAST_NAME>ANOTHER ONE</LAST_NAME>
   <FIRST_NAME>JOHN DOE</FIRST_NAME>
   <CUST_TYPE>VENDOR-NONTAXABLE</CUST_TYPE>
   <BILL_REFERENCE>C654312</BILL_REFERENCE>
   <TAX_CODE>None</TAX_CODE>
   <STATUS>1</STATUS>
   <BILLING_CYCLE>V</BILLING_CYCLE>
   <CUST_NO>C654312 DOE</CUST_NO>
   <ADDR1>123 COUGAR WAY</ADDR1>
   <ADDR2>#1234</ADDR2>
   <CITY>PROVO</CITY>
   <STATE>UT</STATE>
   <ZIP>84602</ZIP>
 </ROW>


I have a work around in place in this case and I know I could manually retrieve and import the data but I don't think I should have to do that.

Any thoughts?

Thanks,
10 REPLIES 10

david_rosalia
Mega Contributor

From what I can see, ServiceNow expects all field in the first record of an xml. Any fields not specifically in the first record are not imported.

Even if you create the missing fields in the import set table it will not fill it during the import.

Is this working as designed? When I look in the documentation I see the comment that the XPATH must be consistent but I don't know if it referring to this issue.


anujamps
Kilo Expert

Did you find a solution for this?



Thank you.


We used the workaround of changing our source file and adding empty tags so all the elements were there in all rows. Not ideal but it worked for our situation since we had control over it.


Were you able to populate data from both the repeated records(ROW and ROW)? We have an XML file with repeated records and only the first record is getting populated it is ignoring the rest of the records.Any thoughts on this?



Thank you.