Excel import on field type currency

Nate23
Mega Guru

Hi all,

I have a few currency fields in the expense line table and I am trying to import about 3k records. I get a java.lang.numberformatexception in the import for the currency fields and only 42 records are inserted before the transform crashes. I delete the cost columns and it works fine thus ServiceNow is having trouble converting the data in the excel to the right format.

I have tried the methods in this post : Import Currency fields from Excel loads the wrong numbers

It does not work for me. I was thinking about trying to run some transform scripts to convert the source data myself. I will give updates if it works, but if someone has a solution for this that would be great.

Thanks for any help,

Nate

1 ACCEPTED SOLUTION

Thanks for the reply I actually found out last night when I tried breaking down the data into smaller pieces to import that there was one value with a "-" in it. I took it out and the full import went in fine.


View solution in original post

3 REPLIES 3

ernyei
Mega Guru

Hi Nathan,



I once had the same problem with the Cost field. The issue was that the Currency data type expects the currency (e.g. USD) and the value together.



It helped me to change the format in the input data to the following:



USD;123.45


Thanks for the reply I actually found out last night when I tried breaking down the data into smaller pieces to import that there was one value with a "-" in it. I took it out and the full import went in fine.


ajit_mallick
Mega Expert

Refer the post below



Re: Importing different currency



It had worked for me.



If you are having multiple currencies on the spreadsheet, add two columns - currency and cost. The currency column should have the code (System Localization -> Currencies) and the cost column should have the decimal number value. The transform map line will look something like -



target.cost = "" + source.u_currency + ";" + source.u_cost + "";



If you are importing one type of currency, use what Ondrej Ernyei suggested above.