Load Data Excel Fields Are Decimal

markmmiller09
Kilo Expert

I am trying to load data into ServiceNow from an Excel file (.xls). The import works however, the date fields become decimal fields. I've tried changing the Excel column to text, and general. I've saved the Excel file as a CSV and looked at the data.

 

Somewhere through the process of loading the Excel file into ServiceNow, the date fields are automatically formatting to decimal fields. I've checked the dictionary of the import table field and set all fields to "string". Why is this happening? Is this a bug in ServiceNow's import option?

 

 

import-table.png

Import Table

 

 

table-dictionary.png

Import Table Dictionary Field

 

 

excel.png

Field in Excel as "Text" format

1 ACCEPTED SOLUTION

adiddigi
Tera Guru

Did you try using a fresh import set table after changing the data from number to text?


View solution in original post

9 REPLIES 9

I needed to delete the import table and create a fresh one. Then I imported only the headers of the excel file as all strings. Once that was complete, I imported the actual data without the headers and it all came over as strings, like I wanted.


Thanks for everyone's help!


Valor1
Giga Guru

If your data is a date, you can do one of two things:


  1. In Excel, make sure the column / text type is set to DATE. SN automatically processes this.
  2. In ServiceNow, open the field mapping entry from the related list on the Transform Map. Note that this is different from the "Mapping assist" functionality.
    • From this form (picture attached), you can set the date format of the data in the field.
    • Even though the system tries to auto-complete formats, you can type whatever you like. (see System Properties > System module for acceptable Date and Time format examples)

Screen Shot 2014-08-04 at 5.29.54 PM.png


garyopela
ServiceNow Employee
ServiceNow Employee

Yeah, so whenever I run into this, to fix it without deleting the import set table, you simply need to go to the import set table, delete the offending column, then manually create one as a string field (or whatever format would work best for you). Then make sure you set the attributes and the column name hte exact same.



For instance, if you had a field called Number1 (u_number1) that, in your import set was created as a decimal, or even integer field and you needed string, do this:


1) Delete the field labeled Number1 (u_number1)


2) Create a new field named Number1 (u_number1) that is String type.


3) Personalize dictionary on the new field and set the attribute to "import_attribute_name=Number1"



I have had to do this many times, as sometimes my first import may have only number data in a text column. Service-Now sees this so creates the field as integer (or decimal). Then my next upload has a few alpha characters in that same column and causes all kinds of problems. Yes, deleting your import set table, then re-importing the spreadsheet with alpha characters (or with just column headers only) would fix this, but to me it's easier to just delete and re-add the column. I just wanted to throw that solution out there as well.


nsomani
Kilo Explorer

Hi All,

 

I am having a decimal field in a form that holds decimal values till 8( scale = 8 and max length =31). when i am trying to load data in that field from excel ( field type is Text) it is removing the 7th digit after upload.

ex: 0.12345678 after upload the field is showing as 0.1234568. Please help.

Ravi Prakash Ro
Tera Expert
Hi All, I am also facing similar issue while importing knowledge articles from excel to service now using easy import method. Service now is auto formating all the links, text colour, space and text alignment to string. All the space are getting removed, links are also coming as string and also text colour is not coming.although I have changed the import set table text field type from string to html. Still same issue. Could anyone please help me how to import the articles into service now with all the existing formatting. Thanks in advance! Ravi Roy