Transform Mapping Currency Field

gtke
Tera Contributor

I have an excel spreadsheet which I am importing into ServiceNow. On the spreadsheet are two columns, one is the currency code (USD, GBP, etc.) and the other is the amount. In my transform map, I can map the amount directly to the currency field which gets the correct amount but always defaults to USD. If I script the field such as:

 

target.spent_amount = source.currency + ';' + source.amount;

 

I still get the currency defaulting to USD but I also get the wrong amount. For example, one record has an amount ~US$1.1million but with the above script I get a result of ~US$315 (not million).

 

How should I script this so that I get both the correct currency code/symbol and the correct amount?

1 ACCEPTED SOLUTION

gtke
Tera Contributor

A colleague got this to work with the following code:



target.spent = "" source.currency + ";" + source.amount + "";


View solution in original post

2 REPLIES 2

gtke
Tera Contributor

A colleague got this to work with the following code:



target.spent = "" source.currency + ";" + source.amount + "";


Hi Friends,



I tried with the solution that you suggested but it is not working. as I need to set currency as SEK and amount but didnt worked.


Importing into cmdb_software_product_model



target.cost = "" source.u_currencyonetime + ";" + source.u_onetime_cost_sek + "";


target.u_recurring_cost = "" source.u_currentcyruntime + ";" + source.u_runtime_cost_sek_per_month + "";



Please suggest



Thanks


Prashant